Differences Between PowerShell Scripting and Traditional Linux/Unix Scripting
PowerShell still uses many of the same programming constructs as other scripting languages use, such as functions, loops, if
constructs, and so forth. But, as you’ve already seen there are also some differences in the basic design of PowerShell that set it apart from traditional Linux/Unix shell scripting. Let’s look at a few examples.
Using Filename Extensions and the Executable Permission
Throughout this book, you’ve seen me create normal Linux/Unix scripts with the .sh
extensions on their filenames. In reality, you don’t have to use any filename extension on normal Linux/Unix scripts. This means that the somescript.sh
script would work just as well if the its filename were just somescript
. With PowerShell, the .ps1
filename extension is mandatory for all PowerShell scripts. Without it, your PowerShell script just won’t run.
On the other hand, it’s...