Appendix 6: Using HPC PowerShell

Applies To: Windows HPC Server 2008

HPC PowerShell is built on Microsoft Windows PowerShell™ technology, and provides a powerful command-line interface and a scripting platform to enable the automation of administrative tasks. HPC PowerShell is installed by default on the head node, and can also be installed on a client computer as part of the utilities available with Windows HPC Server 2008.

To start HPC PowerShell on the head node

  1. Click Start, point to All Programs, and then click Microsoft HPC Pack.

  2. Right-click HPC PowerShell, and then click Run as administrator.

  3. If you are prompted by Windows PowerShell to choose if you want to run the ccppsh.format.ps1xml script, type A, and then press ENTER.

To start HPC PowerShell on a client computer

  1. Click Start, point to All Programs, click Microsoft HPC Pack, and then click HPC PowerShell.

  2. If you are prompted by Windows PowerShell to choose if you want to run the ccppsh.format.ps1xml script, type A, and then press ENTER.

You can also add the HPC PowerShell snap-in from Windows PowerShell.

To add HPC PowerShell from Windows PowerShell

  1. Click Start, point to All Programs, click Windows PowerShell 1.0, and then click Windows PowerShell.

  2. In Windows PowerShell, type the following cmdlet:

    Add-PsSnapin Microsoft.HPC

Add the HPC PowerShell snap-in to your Windows PowerShell profile

If you have a Windows PowerShell profile, you can add the HPC PowerShell snap-in to it so that it is available in every PowerShell session under your user name. For more information about Windows PowerShell profiles, see Windows PowerShell Profiles (https://go.microsoft.com/fwlink/?LinkID=119587).

To add the HPC PowerShell snap-in to your Windows PowerShell profile

  1. Open Windows PowerShell. Click Start, point to All Programs, click Windows PowerShell 1.0, and then click Windows PowerShell.

  2. To edit your profile in Notepad, type:

    notepad $profile

  3. Type the following cmdlet as a new line in the profile:

    Add-PsSnapin Microsoft.HPC

  4. To save the profile, in the File menu, click Save.

  5. To close Notepad, in the File menu, click Exit.

View Help in HPC PowerShell

In-context help is available for HPC PowerShell cmdlets:

  • To view a list of the cmdlets that are available in HPC PowerShell, type the following cmdlet:

    Get-Command –PSSnapin Microsoft.HPC

  • To view basic help information for a specific cmdlet, type:

    Get-Help <cmdlet>

    Where <cmdlet> is an HPC PowerShell cmdlet.

  • To view detailed information for a specific cmdlet, type:

    Get-Help <cmdlet> -Detailed

    Where <cmdlet> is an HPC PowerShell cmdlet.

  • To view the help information on the screen one page at a time, type | More at the end. For example, if you type:

    Get-Help New-HpcJob –Detailed | More

    Only the first page of the detailed information for the New-HpcJob cmdlet will be initially displayed. As you press SPACE or ENTER, more information will be displayed. To stop viewing the help information, press Q.