Implement StorageGRID connection #79
@ -290,6 +290,33 @@ function Connect-To {
|
||||
return $handle
|
||||
}
|
||||
}
|
||||
'NetAppSGWS' {
|
||||
# Construct the splatting for Connect-SgwServer
|
||||
$params = @{
|
||||
Name = $RemoteHost
|
||||
Credential = $creds
|
||||
SkipCertificateCheck = $true
|
||||
}
|
||||
|
||||
# Check if -PassThru was passed. If so, a) do not set the default variable and b) return the
|
||||
# session object to the caller.
|
||||
if ($PSBoundParameters.ContainsKey('PassThru')) {
|
||||
$params.Add('Transient', $true)
|
||||
}
|
||||
|
||||
try {
|
||||
$SgwSession = Connect-SgwServer @params
|
||||
}
|
||||
|
||||
catch {
|
||||
# Write a error message to the log.
|
||||
Write-Error -Message ('Unable to connect to {0} using Type {1}.' -f $RemoteHost, $Type)
|
||||
}
|
||||
|
||||
if ($PSBoundParameters.ContainsKey('PassThru')) {
|
||||
return $SgwSession
|
||||
}
|
||||
}
|
||||
'SCP' {
|
||||
$WinSCPSessionParams = @{
|
||||
Credential = $creds
|
||||
|
Loading…
Reference in New Issue
Block a user