Database Reference
In-Depth Information
In this recipe, we will go through the steps to implement and run PowerShell for SQL Server in
an existing data platform.
Getting ready
In order to implement PowerShell for SQL Server, the operating system must have the
PowerShell feature installed. In Windows Server 2008 onwards, PowerShell is a separate
install, which requires you to download and install an external package.
F To ensure PowerShell is installed on the operating system, open Server Manager
from Administrative Tools program group and go to the Features node to see if the
Windows PowerShell checkbox is ticked
F If the Windows PowerShell is not ticked, then click Add Features and check the box
for Windows PowerShell to install
F Once PowerShell is installed on Windows Server, then PowerShell for SQL Server can
be installed using the SQL Server installation setup utility
F The PowerShell for SQL Server feature can be installed during the initial installation of
SQL Server 2008 R2 or later by accessing the installed features from the SQL Server
setup utility
F The Management Studio add-in is required to install specific PowerShell features:
The add-in installs a PowerShell graphical interface to SSMS
The graphical interface is presented as the SQLCMD utility to
manage scripting
The SQL Server PowerShell provider will add specific functionality in
PowerShell for SQL Server
The SQL Server PowerShell provider can be downloaded from the SQL
Server feature pack: http://www.microsoft.com/downloads/
en/details.aspx?FamilyID=228de03f-3b5a-428a-923f-
58a033d316e1&displaylang=en
How to do it...
Once the previously mentioned prerequisites are met and installed, let us work on the
following steps to implement and run PowerShell for SQL Server provider features.
1.
PowerShell for SQL Server can be accessed by two methods.
Open SQL Server PowerShell through SSMS by right-clicking on any object in
the Object Explorer and select Start PowerShell
Access the PowerShell (SQLPS) console by opening a command prompt
window ; type sqlps.exe and press Enter
 
Search WWH ::




Custom Search