Friday, June 11, 2010

Getting Started with PowerShell

In an attempt to get out of the Cygwin habbit, I have tried Windows PowerShell. It is definitely going in the right direction - not perfect yet, but worth a look.

First, download the Windows Management Framework.

Then, run powershell_ise (on Vista+ - by right-clicking the icon and selecting to run as Administrator). powershell is the shell itself, and runs in the usual command window. powershell_ise is a graphical wrapper around it. The ISE is generally helpful. Note that the ISE fails to run interactive sessions, however, such as the F# interactive.

Next step: run the following in PowerShell, otherwise no scripts will run.

Set-ExecutionPolicy RemoteSigned

Then, you really should create a profile. I store mine in Dropbox, so that I can share it across all the computers:

$dir = split-path -parent $profile # poor-man's dirname
mkdir -f $dir
echo '. "\My Dropbox\powershell\profile.ps1"' > $dir/profile.ps1

Now editing profile.ps1..

No comments:

Post a Comment