< Back

Connect-NsController

Sat Jan 18, 2020 5:12 pm

NAME Connect-NsController



SYNOPSIS

Connects to the api of a NexentaStor controller.





SYNTAX

Connect-NsController [-Name <String>] [-Credential] <PSCredential> [[-Save]] [<CommonParameters>]



Connect-NsController [-Name] <String> [[-Port] <Int32>] [<CommonParameters>]





DESCRIPTION

Uses the parameters given to perform an authentication against the NexetaStor API and sets up an auth token that

can be used by other functions.

The Save option writes the username and password to a file. This allows the Connect-Controller to be called again

without requiring credentials.





PARAMETERS

-Name <String>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Port <Int32>



Required? false

Position? 2

Default value 8443

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-Credential <PSCredential>



Required? true

Position? 4

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-Save [<SwitchParameter>]

Invoke to enable the saving of the given credentials to a file for the controller specified.



Required? false

Position? 5

Default value False

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

Nothing.





NOTES





Credentials are saved per controller and the password is written out as a secure string.

Parameters can be passed as an object.



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Connect-Controller -Name nexentastor-controller.local -Port 443 -Credential (Get-Credential) -Save



Connect to the controller on for 443 and save the credentials to file









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Connect-Controller -Name nexentastor-controller.local -Credential $cred



Connect to the controller on the default port









-------------------------- EXAMPLE 3 --------------------------



PS C:\\>Connect-Controller -Name nexentastor-controller.local



Connect to the controller on the default port using credentials from the saved file











RELATED LINKS