|
Wednesday, April 26, 2006
PowerShell, Change ... is Good ... but Painful
There is a bunch of improvement for console user:
1. Tab completion gets better now.
Did anyone know where is the API mentioned in release note: We added support for parameters and variables tab completion. This was done by having the host call a PowerShell function TabExpansion that takes two parameters – the line being entered and the last token on that line.
2. Some cmdlet Parameters alias changed
For example: *-Process Changed -ProcessName to -Name alias -ProcessName, add alias ProcessId to –Id
This makes me feel much better when working with *-process cmdlet.
Here comes the pain:
1. Change your old script file extention: *.msh - > *.ps1
2. Check into individual script (especially you profile.msh) see if you use any old cmdlet names: for example, combine-path -> join-path
3. Change you %my documents%\msh\profile.msh to %my documents%\PSconfiguration\profile.ps1
If you previously wrote some cmdlets or hosting application, you are going to deal with some mess here:
1. Be careful about name changes:
CmdletAttribute
VerbNounCommand
MshHostRawUserInterface
PSHostRawUserInterface
MshCredential
PSCredential
MshCredentialTypes
PSCredentialTypes
MshCredentialUIOptions
PSCredentialUIOptions
MshInvalidCastException
PSInvalidCastException
Some hidden changes:
FieldDescription.AssemblyFullName
FieldDescription.ParameterAssemblyFullName
FieldDescription.TypeFullName
FieldDescription.ParameterTypeFullName
FieldDescription.TypeName
FieldDescription.ParameterTypeName
BufferCell.Type
BufferCell.BufferCellType
If you are using my “Monad Remoting”
Uninstall “Monad Remoting” before upgrade to “PowerShell”
You’ve been warned!
To use “PowerShell Remoting”, you have to change you client script.
To build your own client, be careful about name change.
PS (12) > $function:tabexpansion
# This is the default function to use for tab expansion. It handles simple
# member expansion on variables, variable name expansion and parameter completion
# on commands. It doesn't understand strings so strings containing ; | ( or { may
# cause expansion to fail.
param($line, $lastWord)
switch -regex ($lastWord)
etc.
-bruce
Bruce Payette [MSFT]
PowerShell Technical Lead
<< Home
Post a Comment