Chapter 26. PowerShell in SQL Server
PowerShell is the automation engine that Microsoft is now building into all of its major products. It started with Exchange Server 2007, Windows Server 2008, and various members of the System Center family, and is now available in SQL Server 2008. You can expect to see it appearing in even more products in the future, as PowerShell is part of Microsoft’s Common Engineering Criteria. Other vendors such as Quest, Special Operations Software, Citrix, and IBM are building PowerShell support into their products. Version 1 became available in November 2006. PowerShell Version 2 is in CTP as of the time of writing. It’s expected to ship with the release of Windows 7 and Windows Server 2008 R2, in which it’ll be installed by default.
So what’s PowerShell and what can we do with it?
PowerShell is usually exposed as a command shell and scripting language. It’s .NET based and can access the .NET framework.
Note
You do NOT have to be a .NET programmer to learn or use PowerShell!
PowerShell is designed to be used interactively and as a scripting language. Anything that can be performed at the command prompt can be performed interactively and vice versa. One of the design goals of PowerShell is that it should be easily extensible. The PowerShell team provides the core PowerShell engine and other product teams build PowerShell snap-ins with the functionality that they require.