Getting Started with PowerShell
Sunday, December 03 2006 - personal, powershell
With the release of the new 2007 products (Exchange and Share Point) we were also given PowerShell.Windows PowerShell is a new Windows command-line shell designed especially for system administrators. The shell includes an interactive prompt and a scripting environment that can be used independently or in Combination.
From the Windows PowerShell Getting Started Guide.
So over the weekend while I was playing with Vista, I also started to look at the PowerShell and what I could do with it. The first step was to download the product and install it, this when without a hitch, next was to print out the documentation and have a read. When starting I was getting the hang of using the command line scripts and what they could be used for... Note that you should get used to the Help commands, "Get-Help", they can get you out of trouble.
But what I really wanted to work out was how to run the scripts that I had collected over the weekend. One thing that I did find out is that the scripting system is basically turned off by default and you need to turn it on. To turn it on you need to change the "Signing and Execution Policies" (You can find information about this by running the "Get-Help About_Signing" command from the PowerShell Prompt.
Use the following command to change the Policy so that you can run scripts, "Set-ExecutionPolicy RemoteSigned" from the PowerShell prompt. Note that I have only done this on my local machine for testing, I have not looked into the full security of the command so I do not know what it will open up. When I find out more I will post.
The next thing that I wanted to do was to add my scripts path to my machines path. In power shell this can be done in several ways, after searching the newsgroups I found 2 methods and each has it's own benefits.
The first command - $env:path += "c:\PowerShell\scripts", will add the path to the current session of the console. Once the console is closed the path will be lost, this can be set in your PowerShell profile so that it will be added each time you start the profile.
The second command - [environment]::SetEnvironmentVariable('path',"$env:Path;c:\PowerShell\scripts",'Machine'), will add the path to the machine and make it permanent.
Anyway that's it for the moment, I will be posting more on my PowerShell travels as I move forward and learn, but for now here are some of the links and resources that I have been using as references.
PowerShell Links and Resources
- PowerShell Home Page
- PowerShell FAQ
- PowerShell Support Newsgroups
- PowerShell Team Blog
- Article Introducing Windows PowerShell
- Article Monad becomes PowerShell
- Blog PowerShelled
- Script Library Readify, Scripts for the Microsoft Commans Shell
I will continue to add to the list as I find more, if anyone has any other links or resources for PowerShell please pass them on.
Similar Posts
- Installing Game Studio Express on Windows Vista
- Creating a DiggIt Module for Community Server 2007
- SQL Server and Powershell Setting up the User Profile
