diff --git a/src/Connection/Connect-To.ps1 b/src/Connection/Connect-To.ps1 index af35c63..a15ab77 100644 --- a/src/Connection/Connect-To.ps1 +++ b/src/Connection/Connect-To.ps1 @@ -258,7 +258,9 @@ function Connect-To { # Check the Connection State if (-not $WinSCPSession.Opened) { # Check the connection state and find out if the session is still open. - Write-Error -Message ('Connection to {0} using Type {1} was established. But now it seems to be lost!' -f $RemoteHost, $Type) + $m = 'Connection to {0} using Type {1} was established. ' -f $RemoteHost, $Type + $m += 'But now it seems to be lost!' + Write-Error -Message $m } } 'NetAppFAS' { @@ -317,7 +319,9 @@ function Connect-To { # Check the Connection State if (!($WinSCPSession.Opened)) { # Check the connection state and find out if the session is still open. - Write-Error -Message ('Connection to {0} using Type {1} was established. But now it seems to be lost!' -f $RemoteHost, $Type) + $m = 'Connection to {0} using Type {1} was established. ' -f $RemoteHost, $Type + $m += 'But now it seems to be lost!' + Write-Error -Message $m } } default {