The information in this article was written about the Community Technology Preview (CTP) of Windows PowerShell 2.0. This information is subject to change in future releases of Windows PowerShell 2.0.
| Windows PowerShell 2.0: Community Technology Preview | |
| Install It | |
| Start It | |
| Configure It | |
| Start Windows Remote Management (WinRM) | |
| Where Do I Start? |
By June Blender
Windows PowerShell Documentation Team
The newest version of Windows PowerShell, Windows PowerShell 2.0 CTP, has been released on the Microsoft Download Center. This release is not quite ready for prime time, but the PowerShell team wanted to give you a peek at what we have planned and get your feedback before we complete our work and release the real thing.
And, although CTP doesn't really stand for "Come To the Party" (it means "Community Technology Preview"), there are so many new and cool features in it, that you'll feel like celebrating. Get the silly hats! Get the balloons!
| • | Remoting: You can run remote commands on one or a hundred machines with a single Windows PowerShell command. |
| • | Graphical PowerShell: A UI for Windows PowerShell that includes a great scripting interface with syntax coloring and selective execution. |
| • | ScriptCmdlets: You can now write Windows PowerShell cmdlets in Windows PowerShell language, not just C#. And you thought cmdlet development was just for developers! |
| • | Background Jobs: You can run local and remote commands in the background while using your console for more urgent work. Then, retrieve the results at your convenience. This new feature uses the remoting features of Windows PowerShell 2.0. |
| • | Debugger: The Windows PowerShell debugger cmdlets let you set breakpoints, step through a script or function, and display the call stack. |
| • | Script Internationalization: Display user messages and help text for a script dynamically in the user's local UI language. |
| • | Data Section: This special section of a script or function isolates data from script logic. It's safer than mixing data with logic, and it lets you keep resource file strings together. |
| • | Out-GridView: Interactive tables of output. Now when you run commands like Get-Process or Get-WmiObject you can manipulate your data with a mouse or keyboard. |
| • | New and Improve WMI Cmdlets: Get-WmiObject is now joined by Remove-WmiObject, Set-WmiInstance and Invoke-WmiMethod. All of the WMI cmdlets now support a convenient EnableAllPrivileges parameter as well as Impersonation, Authentication, and Authority parameters. |
and, best of all,
| • | Updated Help Files: We've fixed the typos and added new and better examples for the cmdlets. The CTP release includes help for all of the new cmdlets and some new About_ files, including about_remoting, about_runspace, and about_debugger. |
Enough! I want it!
To get the Windows PowerShell 2.0 CTP Release, click here.
Read the Release Notes. Really. The release notes include lots of information that can prevent frustration later in the process.
Before installing the CTP release, uninstall Windows PowerShell 1.0. It was installed as a Windows Update, so you need to display the updates in Add and Remove Programs to uninstall it.
| • | Start appwiz.cpl. |
| • | On Windows XP and Windows Server 2003, in Add and Remove Programs, click Show updates. |
| • | On Windows Vista, in Add and Remove Programs, click View installed updates. |
| • | Uninstall Windows PowerShell 1.0. |
Install the required software:
| • | |
| • | Microsoft .NET Framework 3.0 (if you want to use Graphical PowerShell and Out-GridView) |
| • | WS-Management v1.1 (if you want to use Remoting and Background Jobs) |
Install Windows PowerShell 2.0 CTP.
Open Windows PowerShell. On Windows Vista, use the Run as administrator option when opening Windows PowerShell.
On Windows XP and Windows Server 2003:
| • | Click Start / All Programs / Windows PowerShell V2 CTP / Windows PowerShell v2 (CTP). |
On Windows Vista
| • | Click Start / All Programs / Windows PowerShell V2 CTP |
| • | Right-click Windows PowerShell v2 (CTP) and select Run as administrator. |
| • | When prompted, click Allow. |
Many Windows PowerShell commands on Windows Vista require that Windows PowerShell be opened with the Run as administrator option, even if you are a member of the Administrators group on the computer. This is also known as "running elevated". If your access is denied or you cannot open files, try running the command with Windows PowerShell running elevated.
To configure Windows PowerShell for remoting (and for background jobs, which use the remoting infrastructure), run the handy Configure-WsMan.ps1 script. At the Windows PowerShell prompt, type:
& $pshome\configure-wsman.ps1
The & is the invoke operator and $pshome is a variable that contains the path to the Windows PowerShell installation directory.
The script configures WS-Management options for Windows PowerShell. To see the values that the script sets, open the script in Notepad and read the Detailed Description section.
notepad $pshome\configure-wsman.ps1
Windows PowerShell 2.0 uses WS-Management for remoting (and background jobs). To verify that the WinRm service for Ws-Management is started, at the Windows PowerShell prompt, type:
get-service winrm
The output should look like this, with a value of Running in the Status column.
Status Name DisplayName ------ ---- ----------- Running WinRM Windows Remote Management (WS-Manag...
If the Status column has a different value, use the following command to start it.
start-service winrm
If you get an error message on Windows Vista, you probably need to start Windows PowerShell with the Run as administrator option.
If you haven't done so already, read the Release Notes. Yes, really.
Next, read the About file that describes the new features. To see it, at the Windows PowerShell prompt, type:
get-help about_powershell_v2
Now, open Graphical PowerShell and play with it. At the Windows PowerShell prompt, type:
gpowershell
It takes a minute to open, so please be patient.
If you want to try the remoting features, start by getting the processes on another computer.
The other computer must also have Windows PowerShell 2.0 CTP and its required software programs. You must also be a member of the Administrators group on the remote computer.
Invoke-RemoteExpression –computername <computer-name> -command 'get-process'
or the shorter version of the same command:
iex 'get-process' –comp <computer-name>
Out-GridView is fun, too. Try this:
get-process | out-gridview
Click the Id column header. In the Search in Results box, type PowerShell.
There's a lot more, but I don't want to miss the party. See you later! Where's my hat?!