Fix the variable names

This commit is contained in:
pinguinfuss 2023-03-09 13:11:28 +01:00
parent f27f1faad7
commit 9de752691b

View File

@ -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 {