Printer Friendly Version      Send     
Click to Rate and Give Feedback
TechNet
TechNet Library
Operations
Microsoft Forefront System Security
Stirling and PowerShell
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Windows PowerShell provides the foundation for all tasks in the Stirling environment. Each task you perform in the Stirling console is powered by PowerShell, and most of the tasks can be performed independently of the Stirling console, within PowerShell itself.

Stirling functionality in PowerShell is provided by an addition to the PowerShell environment called a snap-in. Snap-ins extend the functionality of PowerShell by adding additional cmdlets to the standard PowerShell environment.

PowerShell performs tasks through the use of cmdlets. Cmdlets are commands in the PowerShell environment that are composed of verb-noun pairs. The verb defines the action to be performed, and the noun defines the item the action is performed on.

For example, to get the list of the available cmdlets in a PowerShell console, type the following in a PowerShell console:

Get-Command

This cmdlet "gets" a list of available "commands".

The output of a cmdlet varies depending on the cmdlet itself and any formatting parameters passed to the cmdlet.

About snap-ins

By default, only the standard PowerShell snap-ins are loaded, or added, to the default PowerShell console. To get a list of the snap-ins currently added to your PowerShell console, use the Get-PSSnapin cmdlet. Type the following in a PowerShell console:

Get-PSSnapin

The output is a list of all snap-ins currently added to the PowerShell console.

If your snap-in is not listed when you use Get-PSSnapin, you must add the snap-in to your PowerShell console. To determine the name of the snap-in, type the following in a PowerShell console:

Get-PSSnapin -Registered

The output is a list of all non-default snap-ins currently installed on your computer.

Once you have the name of the snap-in, you can add it to your PowerShell console. To do this, use the Add-PSSnapin cmdlet. Type the following in a PowerShell console:

Add-PSSnapin name of snapin

There is no output from this cmdlet. However, you can check the list of current snap-ins by using Get-PSSnapin to verify your snap-in was added.

To add the Stirling snap-in to your PowerShell console, type the following in a PowerShell console:

Add-PSSnapin ffspssnapin

The snap-ins added using Add-PSSnapin are only added for that console; if you close the PowerShell console and open it again, you must add the snap-in back into the PowerShell environment.

To load the Stirling snap-in every time you start a PowerShell console, you must create a PowerShell profile.

To create a PowerShell profile
  1. Start Notepad, and then add the following line:

    Add-PSSnapin ffspssnapin

  2. On the menu bar, click File, and then click Save As.

  3. In the folder list, browse to the folder location appropriate for the scope of the profile:

    For a profile that affects all users of the computer, browse to the following location:

    %windir%\system32\windowspowershell\v1.0

    For a profile that affects only the current user, browse to the following location: %UserProfile%\My Documents\windowspowershell

  4. In the File name box, enter Profile.ps1.

  5. In the Save as type box, click on the down arrow, click All Files, and then click Save.

    The Stirling snap-in will now be loaded each time you start PowerShell.

About parameters

Each cmdlet has parameters that are used to provide information to the cmdlet when it runs. Parameters are placed after the cmdlet and are preceded by a dash (-).

Parameters can be either mandatory or optional. Mandatory parameters are used to supply the cmdlet with information necessary to complete the task. Optional parameters are used to either modify the way the cmdlet runs or supply additional information to the cmdlet.

For example, to get the list of Stirling-specific cmdlets installed in the PowerShell environment, you use the same cmdlet mentioned previously, Get-Command. However, this time you must restrict the returned list of cmdlets to those that are provided by the Stirling snap-in. To get the list of cmdlets provided by the Stirling snap-in, type the following in a PowerShell console on the Stirling server:

Get-Command -pSSnapin ffspssnapin

The output is a list of the cmdlets available in the Stirling snap-in (ffspssnapin).

Help in the PowerShell environment is available via a cmdlet. To get help about a cmdlet, type the following in a PowerShell console:

get-help cmdletname

The output is a basic help display in the console itself.

To get help for the cmdlet that creates connections to the Stirling database, type the following:

get-help new-fsyssession

The following table describes the four types of help available in PowerShell for cmdlets.

Help type Output

Basic

When you use the Get-Help cmdlet without any parameters, the output is a brief summary of what the cmdlet does. Included in this summary is the synopsis of the cmdlet, the cmdlet's syntax, and a detailed description of the cmdlet.

Detailed

When the -detailed parameter is used with Get-Help, the help output is expanded to include information about cmdlet parameters.

Full

When the -full parameter is used with Get-Help, the help output is expanded further to include technical details about the parameters.

Examples

When the -examples parameter is used with Get-Help, the help output is restricted to only the synopsis and the usage examples of the cmdlet.

In addition to accessing the Stirling cmdlet help in a PowerShell console, help for each cmdlet is available in the Stirling Technical Reference (http://go.microsoft.com/fwlink/?LinkId=112283).

© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker