Appendix 6: Using HPC PowerShell

 

Applies To: Microsoft HPC Pack 2012, Microsoft HPC Pack 2012 R2

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

The exact steps to start Windows HPC PowerShell depend on the operating system of the computer where HPC Pack is installed and whether the computer is a head node in the cluster or is running only the client utilities.

Note

By default, starting in Windows Server 2012 and Windows 8, the HPC PowerShell shortcut is not pinned to the Start screen after installation of HPC Pack. To pin the shortcut to Start, see Adding apps, websites, and more to Start.

Important

The HPC Pack 2012 R2 and HPC Pack 2012 Client Utilities Redistributable Packages do not enable the Windows HPC PowerShell job submission cmdlets for use by default. To enable the HPC Pack 2012 R2 or HPC Pack 2012 HPC PowerShell job submission cmdlets on a client computer, see Enable HPC PowerShell with the Client Redistributable Package.

To start Windows HPC PowerShell on a Windows Server 2012 R2 or Windows Server 2012 head node

  1. On the Start screen, type, tap, or click HPC PowerShell.

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

To start Windows HPC PowerShell on a Windows Server 2008 R2 head node

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

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

To start Windows HPC PowerShell on a Windows 8 client computer

  • On the Start screen, type, click, or tap HPC PowerShell.

To start Windows HPC PowerShell on a Windows 7 client computer

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

Depending on your operating system and your version of HPC Pack, you can also add the Windows HPC PowerShell snap-in from Windows PowerShell.

Important

If you are running HPC Pack 2012 or later on an operating system earlier than Windows Server 2012 or Windows 8, it is recommended that you start HPC PowerShell from the shortcut installed with HPC Pack, not by adding the snap-in from Windows PowerShell. Depending on the version of .NET Framework that is installed on the operating system, you might see errors when adding the snap-in. In cases where you need to add the snap-in, first set an environment variable that configures an HPC PowerShell activation policy to use the .NET Framework 4.0 runtime.

To add Windows HPC PowerShell from Windows PowerShell

  1. If you are running HPC Pack 2012 or later on an operating system earlier than Windows Server 2012 or Windows 8, set the following environment variable:

    set COMPLUS_ApplicationMigrationRuntimeActivationConfigPath=%CCP_HOME%\bin
    
  2. Start Windows PowerShell. For specific steps for different operating systems, see Starting Windows PowerShell.

  3. In Windows PowerShell, type the following cmdlet:

    Add-PsSnapin Microsoft.HPC

To view Help in Windows HPC PowerShell

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

    Get-Command –PSSnapin Microsoft.HPC

    or

    Get-Command *-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 Spacebar or Enter, more information will be displayed. To stop viewing the help information, press Q.

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

    Get-Help <cmdlet> -Online

    Where <cmdlet> is an HPC PowerShell cmdlet.