Changes in upcoming CTP

PowerShell Team

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)

  1. The attribute declaration for script cmdlets has changed.
    1. Attributes like [Mandatory] or [Position(0)] are now specified as [Parameter(mandatory=$true, position=0)].
    2. Attributes like [ValidateNotNull] now requires parens, like [ValidateNotNull()]
  2. 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.
  3. 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.
  4. New-PSBreakPoint has been replaced by Set-PSBreakPoint.
  5. Set-PSBreakPoint is identical to New-PsBreakPoint, except for the following changes.
    1. The Clone parameter is removed.
    2. The Read, Write, and ReadWrite parameters have been replaced by a Mode parameter with values of Read, Write (default), and ReadWrite.
  6. The following automatic variables have been renamed:
    1. $Culture -> $PSCulture
    2. $UICulture -> $PSUICulture
    3. $Cmdlet -> $PSCmdlet

 

Enjoy!

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

0 comments

Discussion is closed.

Feedback usabilla icon