Shell Script vs PowerShell
People think PowerShell is just the Windows version of a Bash shell script, and it is not. Both run commands one after another from a file. A Bash command hands the next one plain text, which has to be picked apart. A PowerShell command hands over objects with named parts, such as a file's name and size. PowerShell now runs on macOS and Linux too.
Shell Script
A file of commands the shell runs in turn, so you type less.
A shell script is a text file full of commands that a shell runs one after another. Anything you can type at the command line can go in it. The first line, called the shebang, names the shell to use, such as Bash. You make the file runnable once, then run it by name. Scripts save time on jobs you do again and again.
PowerShell
A shell and script language that passes data with named parts, not plain text.
PowerShell is a shell and scripting language for automating computer jobs. Most shells pass plain text from one command to the next. PowerShell passes whole objects, with named parts, so you do not have to cut text up. It runs on Windows, Linux and macOS. It is widely used to manage Windows machines and cloud services.
In one line
- Shell Script
- A file of commands the shell runs in turn, so you type less.
- PowerShell
- A shell and script language that passes data with named parts, not plain text.