Skip to content

NetApp-StorageGRID/StorageGRID-PowerShell-Module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StorageGRID Webscale PowerShell Module

The StorageGRID Webscale Module contains Cmdlets for managing a NetApp StorageGRID Webscale solution.

See the sections below for Installation and Update Instructions see the sections below. For more information check out the StorageGRID Webscale PowerShell Cmdlet Tutorial.

Installation

The StorageGRID Webscale PowerShell Cmdlets require at least PowerShell 4.0 and .NET 4.5.

The recommended way to install the PowerShell Module is through the new Install-Module Cmdlet available since PowerShell 5. Consider installing PowerShell 5 or PowerShell 6. PowerShell 6 now supports Linux, Mac OS X and Windows.

By default PowerShell 5 and later have the official Microsoft PowerShell Gallery defined as installation source, but it is marked as Untrusted by default. To install the Cmdlets you need to trust this installation source using

Set-PSRepository -Name PSGallery -InstallationPolicy Trusted

The StorageGRID Webscale Cmdlets are code signed. PowerShell (currently only on Windows!) can verify the code signature and only run code signed with a trusted certificate. To run the Cmdlets you need to ensure that your execution policy is set to either AllSigned, RemoteSigned, Unrestricted, Bypass. It is recommended to use RemoteSigned.

Get-ExecutionPolicy

You can change the execution policy using the following command. It is recommended to change it only for the current user and use RemoteSigned:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

To install the Cmdlets only for the current user run

Install-Module -Name StorageGRID-Webscale -Scope CurrentUser

To install the Cmdlets for all users, you need to run PowerShell as Administrator and then install them with

Install-Module -Name StorageGRID-Webscale

If you can't install via Install-Module you can download the latest version of StorageGRID-Webscale.zip from the GitHub Release page. Then extract StorageGRID-Webscale.zip to your preferred PowerShell Module location. For the current user to

$HOME\Documents\WindowsPowerShell\Modules

For all users copy the folder to

C:\Windows\System32\WindowsPowerShell\v1.0\Modules

Update

If the Module was installed with Install-Module, it can be upgraded with

Update-Module -Name StorageGRID-Webscale

If the Module was installed by downloading the ZIP file, then update the Module by replacing the StorageGRID-Webscale folder with the content of the new release ZIP file.

Usage

Check if StorageGRID-Webscale Module can be found by PowerShell

    Get-Module -ListAvailable -Name StorageGRID-Webscale

Import PowerShell Module

    Import-Module -Name StorageGRID-Webscale

List all Cmdlets included in the StorageGRID-Webscale Module

    Get-Command -Module StorageGRID-Webscale

List all Cmdlets included in the S3 Client (this command only works with PowerShell 6 and later)

    Get-Command -Module S3-Client

Show help for Cmdlet to connect to StorageGRID Management Server

    Get-Help Connect-SgwServer -Detailed

Connect to StorageGRID Management Server (use the -SkipCertificateCheck switch to skip checking the certificate of the server)

    $Credential = Get-Credential
    $Name = "admin-node.example.org"
    Connect-SgwServer -Name $Name -Credential $Credential -SkipCertificateCheck

List all StorageGRID-Webscale Accounts

    Get-SgwAccounts

Show StorageGRID-Webscale Account Usage

    Get-SgwAccounts | Get-SgwAccountUsage