Share via


Running AppFabric Cmdlets

This topic describes how to start an AppFabric Windows PowerShell console session, import the AppFabric module for Windows PowerShell, and get help on AppFabric cmdlets.

You can execute an AppFabric cmdlet from the command line inside a Windows PowerShell session as long as the AppFabric Windows PowerShell module (the ApplicationServer module) has been loaded into a generic Windows PowerShell session. The ApplicationServer module is automatically imported when you execute the Windows PowerShell Modules command in the Administrative Tools. The ApplicationServer module does not automatically load if you open the Windows PowerShell module by using the icon on the toolbar or the powershell.exe command. In these cases, you must manually import the module as described below. When you do so, the module is loaded only for the current session.

Windows PowerShell has built-in functionality that provides help information from the command line. You access this functionality by using either the Get-Help cmdlet or the Help alias. The default content returned by the Get-Help cmdlet provides a basic description of the cmdlet functionality and syntax. You can supply either the –detailed or the –full parameter to the cmdlet to obtain progressively more detailed information about parameters and other elements of the cmdlet. The Help alias displays the information returned by Get-Help one page at a time. You can also list the AppFabric cmdlets for Windows PowerShell, or output the aggregated help for AppFabric cmdlets, as described below.

To open the AppFabric module for Windows PowerShell

  1. To open the PowerShell console with the AppFabric modules automatically loaded, click Start, point to Administrative Tools, and then click Windows PowerShell Modules.

    Note

    The Windows PowerShell Modules command automatically loads the ApplicationServer, DistributedCacheAdministration, and DistributedCacheConfiguration modules.

  2. To open the PowerShell console with the DistributedCacheAdministration module automatically loaded, click Start, click Microsoft AppFabric 1.1 for Windows Server, and then click Caching Administration Windows PowerShell.

    Note

    The Caching Administration Windows PowerShell command automatically loads the DistributedCacheAdministration module, but does not automatically load the ApplicationServer module or the DistributedCacheConfiguration module.

    Note

    If you open the Windows PowerShell console by a means other than the Windows PowerShell Modules command in the Administrative Tools, you will need to import AppFabric modules (see below). These other methods include the Windows PowerShell command in the Accessories menu, the Windows PowerShell icon on the toolbar, or executing powershell.exe in <drive>:\Windows\System32\WindowsPowerShell\v1.0. You will need to import the AppFabric modules separately, because these methods do not automatically load the AppFabric ApplicationServer module and other modules.

To import the AppFabric module for Windows PowerShell

  1. If you open the Windows PowerShell console by a means other than the Windows PowerShell Modules command in the Administrative Tools, you will need to import the AppFabric modules separately.

  2. Enter one or more of the following commands at the Windows PowerShell prompt and then press ENTER: Import-Module ApplicationServer, Import-Module distributedcacheconfiguration, and Import-Module distributedcacheadministration.

    Note

    You can import the ApplicationServer module for Windows PowerShell without being an administrator on the computer.

    Note

    When you manually import the module, it will remain loaded only for the current session. If you open the console again using one of the preceding methods, you will have to import the module again.

    Note

    To verify that the ApplicationServer module for Windows PowerShell has been loaded, run one or more of following command at the Windows PowerShell prompt and then press ENTER: Get-Command –module ApplicationServer, Get-Command –module distributedcacheconfiguration, and Get-Command –module distributedcacheadministration. Verify that the AppFabric cmdlets are listed.

To get cmdlet help

  1. To get help for a specific cmdlet, enter the following command at the Windows PowerShell prompt and then press ENTER: Get-Help <cmdlet name> [-detailed | -full].

    Note

    For example, to display full help for the Get-ServiceInstance cmdlet, enter the following command at the Windows PowerShell prompt and then press ENTER: Get-Help Get-ServiceInstance –full.

  2. To display a list of the cmdlets provided by the ApplicationServer module on the screen, enter the following command at the Windows PowerShell prompt and then press ENTER: Get-Command –module ApplicationServer.

  3. To print a list of all of the cmdlets provided by the ApplicationServer module to a file, enter the following command at the Windows PowerShell prompt and then press ENTER: Get-Command –module ApplicationServer | Sort-Object > C:\AppFabricCmdlets.txt.

    To print a reference of all of the cmdlet help files provided by the ApplicationServer module to a file, ordered by noun and verb, enter the following command at the Windows PowerShell prompt and then press ENTER: Get-Command –module ApplicationServer | Sort-Object Verb,Noun | Get-Help -detailed > C:\HelpTopicsSortedNounVerb.txt.

  2012-09-12