Implement SGWS

This commit is contained in:
pinguinfuss 2023-03-09 20:16:48 +01:00
parent 22631f2836
commit 4c9c03d7da
1 changed files with 27 additions and 0 deletions

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