Implement StorageGRID connection #79

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

View File

@ -220,9 +220,9 @@ function Connect-To {
Credential = $creds Credential = $creds
ErrorAction = 'Stop' ErrorAction = 'Stop'
} }
$Global:PSExchangeRemote = New-PSSession @ConnectionParams $global:PSExchangeRemote = New-PSSession @ConnectionParams
# ScriptAnalyzer issue (unused var) workaround. # ScriptAnalyzer issue (unused var) workaround.
$null = $Global:PSExchangeRemote $null = $global:PSExchangeRemote
} }
catch { catch {
# Write a error message to the log. # Write a error message to the log.
@ -241,7 +241,7 @@ function Connect-To {
Credential = $creds Credential = $creds
ErrorAction = 'Stop' ErrorAction = 'Stop'
} }
$Global:PSExchangeRemote = New-PSSession @ConnectionParams $global:PSExchangeRemote = New-PSSession @ConnectionParams
} }
catch { catch {
# Write a error message to the log. # Write a error message to the log.
@ -262,7 +262,7 @@ function Connect-To {
} }
try { try {
$FTPSessionOption = New-WinSCPSessionOption @WinSCPConParams $FTPSessionOption = New-WinSCPSessionOption @WinSCPConParams
$Global:WinSCPSession = New-WinSCPSession -SessionOption $FTPSessionOption $global:WinSCPSession = New-WinSCPSession -SessionOption $FTPSessionOption
} }
catch { catch {
throw 'Could not connect to {0} using {1} protocol!' -f $RemoteHost, $Type throw 'Could not connect to {0} using {1} protocol!' -f $RemoteHost, $Type
@ -337,9 +337,9 @@ function Connect-To {
} }
try { try {
$SessionOption = New-WinSCPSessionOption @WinSCPSessionParams $SessionOption = New-WinSCPSessionOption @WinSCPSessionParams
$Global:WinSCPSession = New-WinSCPSession -SessionOption $SessionOption $global:WinSCPSession = New-WinSCPSession -SessionOption $SessionOption
Write-Verbose -Message ( Write-Verbose -Message (
'SCP Connection established with {0}' -f $Global:WinSCPSession.Hostname 'SCP Connection established with {0}' -f $global:WinSCPSession.Hostname
) )
} }
catch { catch {