QuantaStor PowerShell Command Reference: Difference between revisions
mNo edit summary |
|||
Line 15: | Line 15: | ||
Our module is hosted on [https://www.powershellgallery.com/ the PowerShell gallery] and can [https://www.powershellgallery.com/packages/QuantaStor.PowerShell/ be found here]. Installation is easily done through PowerShell: | Our module is hosted on [https://www.powershellgallery.com/ the PowerShell gallery] and can [https://www.powershellgallery.com/packages/QuantaStor.PowerShell/ be found here]. Installation is easily done through PowerShell: | ||
Install-Module -Name QuantaStor.PowerShell | Install-Module -Name QuantaStor.PowerShell | ||
== Environment Variables == | |||
There are two current environment variables <code>QSPath</code> and <code>QSLogin</code>. Unless set, <code>QSPath</code> is <code>http://localhost/</code>. Commands for setting these variables in PowerShell are below: | |||
$Env:QSPath = "http://x.x.x.x:y" | |||
== Commands == | == Commands == | ||
Line 27: | Line 31: | ||
To list all storage pools: | To list all storage pools: | ||
Enum-StoragePool | Enum-StoragePool | ||
$Env:QSLogin = "username:password" | $Env:QSLogin = "username:password" |
Revision as of 00:08, 16 November 2022
PowerShell installation methods
PowerShell is supported on Windows, Linux, and Mac. In addition to system packages and snaps provided by Microsoft, it can also be installed with a functioning recent dotnet SDK as a global tool (If you already have the .NET Core SDK installed):
dotnet tool install --global PowerShell
If you do not have the the .NET Core SDK installed and are on a much older version, then you can use the MSI installation package found at the following URL: https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.3#msi
Recommended versions
To use the QuantaStor PowerShell module, you must be on PowerShell 7 or newer and dotnet 6 or newer.
To check what version you have installed, execute the following command from a PowerShell console: $PSVersionTable
QuantaStor PowerShell module installation
Our module is hosted on the PowerShell gallery and can be found here. Installation is easily done through PowerShell:
Install-Module -Name QuantaStor.PowerShell
Environment Variables
There are two current environment variables QSPath
and QSLogin
. Unless set, QSPath
is http://localhost/
. Commands for setting these variables in PowerShell are below:
$Env:QSPath = "http://x.x.x.x:y"
Commands
The commands can be slightly renamed from other instances to be closer to PowerShell standards. For example instead of UserEnum
there is Enum-User
. All commands can be listed with:
Get-Command -Module QuantaStor.PowerShell
And help for a command can be viewed with:
Get-Help COMMAND
For example to view the parameters of Add-User
:
Get-Help Add-User
To list all users:
Enum-User
To list all storage pools:
Enum-StoragePool
$Env:QSLogin = "username:password"