|
|
|
|
|
by vacri
3763 days ago
|
|
And if we're going to be using the commandline, I'd much rather the unixy find PATH -name FOO
than the powershelly Get-ChildItem -Path PATH -Filter FOO -Recurse
I mean "dir FOO /s" is simple and all, but powershell was created because cmd was deficient in many areas.The blogpost referenced in the article is also stacking the deck a bit, as some of the 'complex' commands are normal commands, but with the verbosity turned up - the rsync command has three flags for increasing verbosity... |
|
PowerShell has over cmd (and WSH):
- Consistency in command handling, naming and discoverablity
- A robust scripting language
- A modern shell
- An embeddable scripting environment (most GUI configuration stuff on Windows Server these days is PowerShell in the background; PowerShell is also the NuGet console in VS)
- Extensible
- The core of the language is built up from mostly orthogonal commands which work completely the same regardless of the context
- Interoperable with native commands, .NET, COM, WMI, arbitrary item hierarchies (file systems, registry, etc. – comes back to consistency and the point above)
- SSH-like capabilities built-in. Running a command or a series of commands over hundreds of machines is no harder than doing it locally.
The (perceived) verbosity can usually be tamed quite a bit with aliases and shortening parameters (or using them positionally), which is what you'd do most of the time when working with the shell once familiar with it. I guess you're not yet familiar with PowerShell or never used it, and that's okay. Because the long commands are in many, many cases self-describing to the point that you don't have to guess at all what they mean or do. This also helps with learning or communicating with others.