Changes from Windows PowerShell RC2
There were no breaking changes between Windows PowerShell RC2 and the final V1.0 version of Windows PowerShell. The following list describes features that were not mentioned in the RC2 release notes, but are worth noting.
Support for ADSI:
We have added direct ADSI support to Windows PowerShell to allow users to more easily administer Active Directory. You can now create ADSI objects, get properties, and invoke methods on Active Directory objects.
Example: (Create an OU)
PS >$objDomain = [ADSI]"LDAP://localhost:389/dc=NA,dc=fabrikam,dc=com"
PS >$objOU = $objDomain.Create("organizationalUnit", "ou=HR")
PS >$objOU.SetInfo()
New Product ID:
The RC2 version of Windows PowerShell has a product ID (PID) that is stored in the following registry key with the following value:
HKLM\Software\Microsoft\PowerShell\1 PID=89393-100-0001260-00301
In the final V1.0 version, the PID number is changed to:
HKLM\Software\Microsoft\PowerShell\1 PID= 89383-100-0001260-04309
New Location for Profiles:
Windows PowerShell profiles are now located in the WindowsPowerShell directory, not the PSConfiguration directory.
The profiles for all users are located in:
%windir%\system32\WindowsPowerShell\v1.0\profile.ps1
%windir%\system32\WindowsPowerShell\v1.0\ Microsoft.PowerShell_profile.ps1
User-specific profiles are located in a WindowsPowerShell directory in the %UserProfile% directory.
On 64-bit versions of Windows, Windows PowerShell includes a second set of profiles for all users. These are located in:
%windir%\syswow64\WindowsPowerShell\v1.0\profile.ps1
%windir%\syswow64\WindowsPowerShell\v1.0\ Microsoft.PowerShell_profile.ps1
As before, the Microsoft.PowerShell_profile.ps1 profiles are specific to the Microsoft.PowerShell shell, and the profile.ps1 profiles apply to all shells.
Changes from Windows PowerShell RC1
Improved error output readability:
A new object is available by using $host.PrivateData. This object, the ConsoleColorProxy, lets you set the color of output in the shell.
To see the current colors, type "$host.privatedata".
PS > $host.privatedata
ErrorForegroundColor : Red
ErrorBackgroundColor : Black
WarningForegroundColor : Yellow
WarningBackgroundColor : Black
DebugForegroundColor : Yellow
DebugBackgroundColor : Black
VerboseForegroundColor : Yellow
VerboseBackgroundColor : Black
ProgressForegroundColor : Yellow
ProgressBackgroundColor : DarkCyan
To see the properties and methods of the ConsoleColorProxy object, pipe it to Get-Member. For example:
PS > $host.privatedata | get-member
To change the colors, set the value of a property to the desired color. For example, to change the error background color to blue, type:
PS > $host.privatedata.ErrorBackgroundColor = "blue"
Posted in: Windows| Tags: Windows PowerShell PowerShell Windows Windows PowerShell RC2 ADSI LDAP PID Microsoft.PowerShell_profile WindowsPowerShell readability host.privatedata ConsoleColorProxy get-member