SANtricity commands

Format rules for CLI commands in Windows PowerShell

Contributors netapp-jsnyder

The Windows PowerShell is an interactive and scripting shell that provides access to command-line tools. The Windows PowerShell improves upon the Windows Command Prompt with a more robust set of commands and scripting capability. You can run all of the CLI and script commands in the Windows PowerShell; however, the Windows PowerShell has some unique formatting requirements. The requirements are these:

  • Begin all SMcli commands with a period and a forward slash (./)

  • SMcli wrapper must be identified as an executable command with the .exe extension (SMcli.exe)

  • Enclose the script command in single quotation marks (' ')

  • Double quotation marks that are part of a name, file path, or value must have a backslash before each double quotation mark character (\")

The following is an example of a CLI command to create a storage array name in the Windows PowerShell. Note the use of the single quotation marks as delimiters for the script command and the backslash double quotation marks around the storage array name, identified as userLabel in the command syntax.

PS C:\...\StorageManager\client> ./SMcli.exe
-c ’set storageArray userLabel=\"Engineering\";’

The following is an example of a CLI command to enable a premium feature in the Windows PowerShell. Note the use of the backslash double quotation marks before the file path to the premium feature key.

PS C:\...\StorageManager\client> ./SMcli.exe
-c ’enable storageArray feature file=\"C:\licenseKey.bin\";’

In the previous examples both upper case letters and lower case letters are used. This use is to help make clear how the commands are formatted. The Windows PowerShell is, however, not case sensitive and does not require the use specific cases.