Comparing Windows PowerShell and Bash

Slashdot it! Delicious Share on Facebook Tweet! Digg!

Assistance

To get command help in Bash, you can just enter apropos <keyword> , which lists all commands that include the given keyword. To find out which options a command supports, simply enter the command without options. To get to know Bash even better, a look at the Bash Reference also helps [6].

There is indeed a Get-Help cmdlet in PowerShell, but it doesn't help beginners in dealing with slightly more complex objects. Microsoft therefore provides a small development environment for PowerShell that includes an interactive overview of the commands and lets you explore the cmdlet properties to be able to test, activate, or configure them (Figure 1).

Figure 1: The PowerShell ISE development environment is part of the PowerShell installation.

The PowerShell Integrated Scripting Environment (ISE) proves to be quite useful in that it not only makes working with cmdlets easier, but it also includes a debugger that executes the scripts step by step to help in troubleshooting. You can also use ISE to start a PowerShell on a remote computer, similar to SSH in Linux. For this to work, the administrator needs to allow remote access emitting the Enable-PSRemoting -Force command, which evokes the WinRM service to provide the access.

The question of a development environment doesn't even come up for many Linux admins in that powerful editors such as Vim or Emacs have many functions that facilitate scripting, such as syntax highlighting, complex functions to navigate scripts, and built-in macros. Editors of this kind have not as yet become standard Windows features.

Conclusion

The examples I have given show how different the shell concepts are. Aliases such as ls, mkdir and ps might make the changeover of admins from Unix to Windows easier, but it's doubtful that this will make any difference in the end.

PowerShell shows its strengths mainly in administering Microsoft server applications. The cmdlets are designed to execute tasks with a minimum of commands. The reason entire objects are used to communicate instead of plain text is because of the underlying framework more than to simplify administration.

Bash takes a completely different approach. Shell scripts don't manage products but rather a versatility of tools. For more complex tasks, you can use specialized interpreters such as Perl and Ruby. The main purpose of Bash is to manage systems.

Buy this article as PDF

Express-Checkout as PDF

Pages: 4

Price $0.99
(incl. VAT)

Buy Ubuntu User

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content