Get Started with POSH4ONTAP on Windows 7

by Frequent Contributor on ‎2010-08-25 12:40 AM

This quick write-up should you give the necessary steps to get started with POSH4ONTAP on a Windows 7 box. In case you are using another version of Windows, check the notes at the very end.

First off all, Windows 7 comes with powershell v2.0 installed. BUT, script execution is disabled.

1. Enter the powershell land

open a cmd.exe and enter powershell

C:\Users\netapp> powershell

2. Check the script execution policy

PS C:\DataONTAP> Get-ExecutionPolicy

--> by the way: tab is your friend and will complete commands :-)

3. Change the script execution policy

PS C:\DataONTAP> Set-ExecutionPolicy RemoteSigned

--> means you can run your own scripts, but downloaded ones needs to be signed

At this point I got an error message with access denied. Google told me that my AV-scanner might have prevented the access.

Ok, get the relevant key into the registry by hand...

# Open regedit.exe
# Browse to key HKLM\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell
# If “ExecutionPolicy” does not exist, create it as REG_SZ with value “RemoteSigned”

Check the execution policy:

PS C:\DataONTAP> Get-ExecutionPolicy

Note: you might have to change it to Unrestricted. See the following page to get more insight about execution policy:

4. Install POSH4ONTAP

-download DataONTAP.msi (since v2.2 the powershell toolkit for ONTAP is coming with an installer) (version 2.3)

-double click the msi-file and follow the installer

In case you have former versions installed, you can easely check if you are using the newest:

PS C:\DataONTAP> Import-Module DataONTAP

PS C:\DataONTAP> Get-NaToolkitVersion

Major  Minor  Build  Revision

-----  -----  -----  --------

2      3      0      81

7. Get started with POSH4ONTAP :-)

PS C:\DataONTAP> Import-Module DataONTAP

PS C:\DataONTAP> Find-NaController | ft Name, Status, StatusMessag
e -Autosize

Name     Status      StatusMessage
----     ------      -------------
superman Critical    Cluster failover of catwoman is not possible: cluster t...
catwoman Critical    Cluster failover of superman is not possible: cluster t...
talbot   Noncritical Disk on adapter 0a, shelf 2, bay 1, failed.
trabant  OK          The system's global status is normal.
axi-270  OK          The system's global status is normal.
jeti-250 OK          The system's global status is normal.

8. Do some RTFM

Use the follwing commands to get access to help:

List available commands

PS C:\DataONTAP> Get-Command -Module DataONTAP

Get online help for a specifc command

PS C:\DataONTAP> Get-Help New-NaVol

Toolkit help in a browser

PS C:\DataONTAP> Show-NaHelp

Using older versions of Windows

Make sure you are using Powershell v2.0. Use the following command to verify:

C:\Users\netapp> powershell

Windows PowerShell

Copyright (C) 2009 Microsoft Corporation. All rights reserved.

PS C:\Users\netapp> $psversiontable.psversion

Major  Minor  Build  Revision

-----  -----  -----  --------

2      0      -1     -1

If you have an older version check:


This NetApp Community is public and open website that is indexed by search engines such as Google. Participation in the NetApp Community is voluntary. All content posted on the NetApp Community is publicly viewable and available. This includes the rich text editor which is not encrypted for https.

In accordance to our Code of Conduct and Community Terms of Use DO NOT post or attach the following:

  • Software files (compressed or uncompressed)
  • Files that require an End User License Agreement (EULA)
  • Confidential information
  • Personal data you do not want publicly available
  • Another’s personally identifiable information
  • Copyrighted materials without the permission of the copyright owner

Files and content that do not abide by the Community Terms of Use or Code of Conduct will be removed. Continued non-compliance may result in NetApp Community account restrictions or termination.