Monday, March 15, 2010

PowerShell 2.0

PowerShell is slowly but steadily gathering steam if one were to gauge by the number of powershell projects in codeplex. PowerShell 2.0 is now available for download from the micorosft site: http://support.microsoft.com/kb/968929. The powershell version 2.0 includes a script editor which is called Powershell ISE, the editor makes it a lot easier to write powershell scripts.  Here is a snapshot of how the Windows ISE Editor looks...

The script editor has the ability to open multiple script files by using the tab interface. The key powershell cmdlets are highlighted in color which provides more readability. The script editor also has a help section which provides pretty good examples in powershell commands. With the advent of the editor writing  Powershell scripts for sqlserver has become much more easier in terms of coding and debugging the scripts. There are different ways to get into the sql server powershell mode, one is using the PSSnapin command:
Add-PSSnapin SqlServerCmdletSnapin100,
Add-PSSnapin SqlServerProviderSnapin100
The other way is to make SMO calls and instantiate SMO objects pertaining to SQL Server. There is a popular SQL Server PowerShell Library availalbe in Codeplex called SQLPSX, the latest version is 2.1,here is the link:
http://www.codeplex.com/SQLPSX

No comments:

Post a Comment