Implement StorageGRID connection #79

Open
pinguinfuss wants to merge 23 commits from pinguinfuss/PSCredentialStore:ConnectTo-StorageGRID into master
1 changed files with 27 additions and 0 deletions
Showing only changes of commit 4c9c03d7da - Show all commits

View File

@ -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