Why I Love Powershell
PowerShell, a better shell, after 30 years of unix crap
Here's reasons why PowerShell is a magnitude better than bash + unix util bags.
Consistent Command Names
PowerShell has proper command names. Names are full and meaningful. Example:
Get-ChildItem
(aliasls
)Select-String
(aliasgrep
)New-Item
(aliastouch
,mkdir
)Get-Content
(aliascat
)Compare-Object
(aliasdiff
)Get-Help
(aliasman
)
they follow a verb-noun design. I don't like it, but at least it's consistent and not cryptic.
Systematic Alias and Name Completion
PowerShell has systematic alias and name completion. Completion works for parameter names too. For example: Get-ChildItem
has abbrev gci
.
(and also dir
and ls
for cmd.exe and bash adoption)
[see PowerShell: List of Aliases]
Consistent Parameter Syntax, Parameter Names, Parameter Semantic
PowerShell's parameters, are consistent in syntax, name, and meaning, of their order, position, default values, for ALL commands.
For example, -Recurse
has the same meaning for every command, and every command that recurses have that parameter.
For example,
-Path
, -LiteralPath
,
are parameters for any command that takes a path,
and path expansion is handled in a universal way. Boolean parameters are handled consistently.
Unlike the unix situation where every command has its own wild parameter names and meaning. [see Unix Pipe as Functional Language]
Best Documentation
PowerShell documentation is superb, well written, consistent format, with plenty code examples. I'd rate PowerShell doc to be one of the best in computing. [see Which Programing Language Has Best Documentation?]
Strongly Typed, But Type Optional
PowerShell has formalized data types and pipe. It's not just strings. every value in PowerShell is a object, of specific type, of the dotnet framework. Numbers, string, and other argument values, expression, all have proper type, and object with methods. You can annotate types when writing a function that prevents many errors.
General Purpose Language, Not Just Text Processing
PowerShell commands are more general.
e.g. Get-ChildItem
is not just for listing directory, but for listing any list and tree structures.
For example, registry, environment variables.
PowerShell is now cross-platform since 2016. Works on linux and macOS too.