Microsoft have (finally) released a new scripting language for XP, Vista and its server Products called PowerShell. This is a vast improvement on the bad old days of writing everything in DOS. It will be installed by default in Windows 2008, however for earlier OS products you can get it from the Microsoft Site.
Installation
Here are the instructions for getting a copy. Download and run the EXE from the Microsoft site and follow the online prompts. Just choose the defaults for all the settings and agree the Licence Agreement.
This will add a new item to your Start menu, selecting the Windows Power Shell item will bring you into the PowerShell environment, which is much the same as the standard Command (CMD.EXE) window except you had access to a whole set of new functions and facilities.
Creating a basic Power Shell Script
You can create a Powershell script using notepad, Visual Studio or any text editor, however this is a little limited. I’d recommend the free Power Shell GUI application which can be downloaded and installed. This gives you IntelliSense some debugging facilities. Just download and install selecting all the standard default.
When you start PowerGUI you get this friendly and basically useless console window. Just ignore this until you get to the stage of wanting to add your own scripts to the tree. Your main editor is available from the Tools/PowerGUI Script Editor option on the menu.
From here on you can just type your PowerShell scripts and and press the Play button to see it in action.
Power Shell Script Resources
There are numerous examples of good PowerShell scripts on the Internet here are a few I use:
No comments:
Post a Comment