3 ms·
Its not for me to say what will or wont be easy for you to pickup, given your prior experience with bash. IMHO Powershell has gone so far beyond bash that its n
by ksk 10y ago
Its not for me to say what will or wont be easy for you to pickup, given your prior experience with bash. IMHO Powershell has gone so far beyond bash that its not even fair to compare them. PS has combined all the objected oriented APIs inside windows (WMI, .NET etc) and you don't have to constantly convert to and from strings, which is brittle to begin with. PS can simply pass around in-memory objects, making it far more efficient. Powershell also has real types and this helps reduce scripting errors. There are lots of nice things in powershell, so for e.g. even if you didn't know the properties, you can autocomplete after typing "ls | sort -property" and can choose one. AFAIK you can't do this on a shell that doesn't use objects. You'll find that the design of the command names is mostly consistent with verb-noun format. I'm not even a sysadmin, I do embedded systems programming, but I still appreciate some of the niceties in PS. For e.g.
Reading HN :
irm https://news.ycombinator.com/rss
Stop all my VMs :
get-vm | stop-vm
Stop all processes consuming more than 1GB:
ps | ?{$_.WS -gt 1GB} | kill
Find all empty folders:
ls -r | ?{-not($_|ls)}
All the PDFs that I downloaded this month:
ls -r *.pdf | ?{$_.CreationTime -gt "4/1/2017"}