4 Running commands
When you start looking at PowerShell examples on the internet, it’s easy to get the impression that PowerShell is some kind of .NET–based scripting or programming language. Our fellow Microsoft Most Valuable Professional (MVP) award recipients, and hundreds of other PowerShell users, are pretty serious geeks who like to dig deep into the shell to see what we can make it do. But almost all of us began right where this chapter starts: running commands. That’s what you’ll be doing in this chapter: not scripting, not programming, but running commands and command-line utilities.
4.1 Not scripting, but running commands
PowerShell, as its name indicates, is a shell. cmd.exe, bash, zsh, fish, ksh are other names of shells you’ve probably used or at least heard of. PowerShell is not only a shell but a scripting language as well – but not in the way JavaScript or Python are.
With those languages, as with most programming languages, you sit down in front of a text editor or Integrated Development Environment (IDE) and type a series of keywords to form a script. You save that file, and perhaps double-click it to test it. PowerShell can work like that, but that’s not necessarily the main usage pattern for PowerShell, particularly when you’re getting started. With PowerShell, you type a command, add a few parameters to customize the command’s behavior, hit Enter, and immediately see your results.