Changes in upcoming CTP
In my earlier blog, I mentioned that we had changed things since the previous CTP. Rather than leave everyone wondering whether they were doomed or not, I decided to have an early release of that portion of the release notes. Here they are:
Breaking Changes to Windows PowerShell 1.0
1. The value of the PowerShellVersion registry entry in HKLM\SOFTWARE\Microsoft\PowerShell\1\PowerShellEngine has been changed to 2.0.
2. Added new language keywords: Data, Cmdlet, and DynamicParam. Any commands called data, cmdlet or dynamicParam are interpreted as language keywords and result in parsing errors.
3. Changes in argument separator behavior. In Windows PowerShell 1.0, $a.method(,1) is interpreted as a call with an array of 1 element, but $a.method(1,,2) generates a parsing error. In Windows PowerShell V2, both formats generate parsing errors.
4. New cmdlets and variables have been added. These are listed below. These new elements might conflict with variables and functions in profiles and scripts.
Breaking Changes to Windows PowerShell V2 (CTP)
- The attribute declaration for script cmdlets has changed.
- Attributes like [Mandatory] or [Position(0)] are now specified as [Parameter(mandatory=$true, position=0)].
- Attributes like [ValidateNotNull] now requires parens, like [ValidateNotNull()]
- The remoting parameter sets (Runspace, Uri, and ComputerName)have been removed from the Invoke-Expression cmdlet. To run remote commands, use the Invoke-Command cmdlet.
- The remoting parameters (Computername, Port, UseSSL, Credential, ShellName, and ThrottleLimit) have been removed from the Start-PsJob cmdlet. To run background jobs remotely, use the AsJob parameter of Invoke-Command.
- New-PSBreakPoint has been replaced by Set-PSBreakPoint.
- Set-PSBreakPoint is identical to New-PsBreakPoint, except for the following changes.
- The Clone parameter is removed.
- The Read, Write, and ReadWrite parameters have been replaced by a Mode parameter with values of Read, Write (default), and ReadWrite.
- The following automatic variables have been renamed:
- $Culture -> $PSCulture
- $UICulture -> $PSUICulture
- $Cmdlet -> $PSCmdlet
Jeffrey Snover [MSFT]
Windows Management Partner Architect
Visit the Windows PowerShell Team blog at: http://blogs.msdn.com/PowerShell
Visit the Windows PowerShell ScriptCenter at: http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx