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