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