Implement StorageGRID connection #79

Open
pinguinfuss wants to merge 23 commits from pinguinfuss/PSCredentialStore:ConnectTo-StorageGRID into master
Showing only changes of commit 1747bb24a8 - Show all commits

View File

@ -199,6 +199,7 @@ function Connect-To {
Write-Error -Message ('Unable to connect to {0} using Type {1}.' -f $RemoteHost, $Type)
}
}
'CiscoUcsCentral' {
try {
$handle = Connect-UcsCentral -Name $RemoteHost -Credential $creds -NotDefault
@ -209,6 +210,7 @@ function Connect-To {
Write-Error -Message ('Unable to connect to {0} using {1}' -f $RemoteHost, $Type)
}
}
'ExchangeHTTP' {
try {
$ConnectionParams = @{
@ -225,6 +227,7 @@ function Connect-To {
Write-Error -Message ('Unable to connect to {0} using Type {1}.' -f $RemoteHost, $Type)
}
}
'ExchangeHTTPS' {
try {
$ConnectionParams = @{
@ -239,6 +242,7 @@ function Connect-To {
Write-Error -Message ('Unable to connect to {0} using Type {1}.' -f $RemoteHost, $Type)
}
}
'FTP' {
# First establish the FTP session
$WinSCPConParams = @{
@ -247,6 +251,7 @@ function Connect-To {
Protocol = 'Ftp'
FtpMode = 'Passive'
}
try {
$FTPSessionOption = New-WinSCPSessionOption @WinSCPConParams
$global:WinSCPSession = New-WinSCPSession -SessionOption $FTPSessionOption
@ -263,6 +268,7 @@ function Connect-To {
Write-Error -Message $m
}
}
'NetAppFAS' {
# Construct the splatting for Connect-NcController
$params = @{
@ -290,6 +296,7 @@ function Connect-To {
return $handle
}
}
'NetAppSGWS' {
# Construct the splatting for Connect-SgwServer
$params = @{
@ -317,6 +324,7 @@ function Connect-To {
return $SgwSession
}
}
'SCP' {
$WinSCPSessionParams = @{
Credential = $creds
@ -343,6 +351,7 @@ function Connect-To {
Write-Error -Message $m
}
}
'VMware' {
try {
Connect-VIServer -Server $RemoteHost -Credential $creds -ErrorAction Stop | Out-Null
@ -353,6 +362,7 @@ function Connect-To {
Write-Error -Message ('Unable to connect to {0} using Type {1}.' -f $RemoteHost, $Type)
}
}
'VMwareCisServer' {
try {
if ($PassThru.IsPresent) {
@ -368,10 +378,6 @@ function Connect-To {
Write-Error -Message ('Unable to connect to {0} using Type {1}.' -f $RemoteHost, $Type)
}
}
default {
# Write a error message to the log.
Write-Error -Message ('Unable to connect to {0} using Type {1}.' -f $RemoteHost, $Type)
}
}
}
}