I discovered windows powershell earlier today and have to say, this brilliant scripting tool needs to be embraced. It’s your friend!
Powershell can be downloaded from Microsoft at http://blogs.msdn.com/b/powershell/archive/2008/12/30/download-windows-powershell.aspx
For help getting started, there’s a brilliant scripting site, also available through Microsoft
You can also download a free reference card from http://refcardz.dzone.com/refcardz/windows-powershell to help you get started.
Writing a quick powershell Hello World example
1. Create the following code using notepad with the filename c:\Hello.ps1:
# Filename: Hello.ps1
Write-Host ‘Hello World!’
Write-Host "Good-bye World! `n"
# end of script
2. Lanch powershell (Start > Run > Powershell)
3. Type Set-Location ‘c:\’ to change the directory to where you want to run the script from
4. Type .\Hello to run the script within powershell and press enter
The first time I ran the script, I received an error message = Hello.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see "get-help about-signing" for more details.
To fix this problem type Set-ExecutionPolicy RemoteSigned and press enter. Now re-run you script and off you go.