June 7, 2009

Powershell 101 - Setting Up
[Part I in a series to get you started]

If you're using Vista, Windows Server 2003 or earlier, you must install Powershell into your OS. Requirements are .Net Framework 2.0 or higher and Powershell 1.0. Both are available as downloads from Microsoft. To install Powershell v2.0 you'll need .Net 3.5 to support the new "remoting" features (See the updated download link at the bottom of this post).


Getting Started
If you expect to be running Powershell scripts on your system (and why wouldn't you), you'll have to modify the default setting for ExecutionPolicy. By default, Powershell restricts the running of ALL scripts for security reasons. To allow only local scripts to run, set the policy to RemoteSigned. With this set, only scripts local to your system will be allowed to execute. To set this policy, type the following at the Powershell prompt:
Set-ExecutionPolicy RemoteSigned

Useful Cmdlets to Get You Started
Get-ExecutionPolicy
Will display the current policy set on your system.

Get-Command
Will display all available cmdlets on your system.

Get-Help...
Displays help information for cmdlets & topics.

Get-PSDrive
Displays all logical drives on your system.

Get-PSSnapin
Displays Powershell Snapins (specialized shell cmdlet libraries) that are loaded in your current Powershell session.

Get-PSSnapin -registered
Displays Powershell Snapins that are installed and available on your system and can be loaded in your session using the Add-PSSnapin cmdlet.



[Resources in this post]
Get Windows Management Framework here.
Powershell Quick Reference Card here.

.end

No comments:

Post a Comment