Friday, January 7, 2011

Using Powershell in Windows 7

For years people that have come from a Unix background have complained about the lack of command line tools that the Windows line of operating systems just did not supply.

The most recent line of Windows operating systems has a virtual dos based command line but it in no way had the large amount of features that something like the Bash command line had over in Linux.

Several years ago Microsoft introduced the Powershell command line system to windows. It's purpose was to bring a powerful command line editor similar to what people had over in the Unix family.

The only thing that was different is that you had to download Powershell separately from the actual operating system. Now with the release of Windows 7, Powershell comes with the operating system ready for action.

Powershell is not a feature that is meant for most of the Windows user out there. Most people like the graphical interfaces that Windows provides and would hate to be forced to do anything by command line like you are sometimes forced to do in Linux.

Powershell was not created with that in mind. It was created so that people that were use to working in Linux and other Unix based operating systems felt more comfortable about making the switch over to windows.

To turn on Powershell in Windows 7 you first have to click on the Start button, then hit All programs.

After that click on accessories and scroll down until you see the Windows PowerShell folder.

Click on that and you will see a blue screen pop up waiting for a command to be typed in.

People who are not used to using a powerful command line tool might be thinking that this no different than using the old version of command line. They are wrong, for one thing you have a feature called pipe lining that is available now. This is a feature that allows you to take the output of one program and input into another program.

For an example, if you were typing text into notepad and wanted to email it, all you would have to do is type one command into powershell, which would send the text to the email program and the action would be done. Pipelining is a powerful feature once you get used to using it.

Powershell also comes with a powerful scripting language that is not only object orientated but also is considered a first class citizen of the .Net family. This will allow you to create shell scripts like you can in Unix. The difference is that the scripts will be able to reach out to the .Net framework and make a ton of features easier to access. When you script something in powershell it is called making a cmdlet.

There is so much that you can do with with the scripting language that we will not be able to cover it all here.

Another feature that was made particularly for the people that are coming from a unix background is the ability to give Powershell commands aliases. This means that if a command has one name, you can force that same command to be called by another name. For example in windows usually if you want to see the contents of a directory in the command line you would call the "dir" command.

If you are coming from a Linux background then you would type that same command as "ls". Now instead of getting used to the windows version, they have already created an alias for you where "ls" will do the expected behavior that someone from a linux background would expect. You can also make your own custom aliases as well.

I hope that we have giving you a good ideal why the Windows Powershell in Windows 7 is such a good thing. even if you are not coming from a Unix/Linux background learning the powershell can make your computing experience a lot easier.

Read more: http://www.articlesbase.com/operating-systems-articles/using-powershell-in-windows-7-1692410.html#ixzz1ALLejhVy
Under Creative Commons License: Attribution

0 comments

Post a Comment