From 1747bb24a85b68057924d3a192cfe06afbfa30f1 Mon Sep 17 00:00:00 2001 From: pinguinfuss Date: Thu, 9 Mar 2023 20:33:27 +0100 Subject: [PATCH] Add a bit of spacing. Remove default as there is nothing to do. --- src/Connection/Connect-To.ps1 | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Connection/Connect-To.ps1 b/src/Connection/Connect-To.ps1 index e709d7c..863d4ee 100644 --- a/src/Connection/Connect-To.ps1 +++ b/src/Connection/Connect-To.ps1 @@ -199,6 +199,7 @@ function Connect-To { Write-Error -Message ('Unable to connect to {0} using Type {1}.' -f $RemoteHost, $Type) } } + 'CiscoUcsCentral' { try { $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) } } + 'ExchangeHTTP' { try { $ConnectionParams = @{ @@ -225,6 +227,7 @@ function Connect-To { Write-Error -Message ('Unable to connect to {0} using Type {1}.' -f $RemoteHost, $Type) } } + 'ExchangeHTTPS' { try { $ConnectionParams = @{ @@ -239,6 +242,7 @@ function Connect-To { Write-Error -Message ('Unable to connect to {0} using Type {1}.' -f $RemoteHost, $Type) } } + 'FTP' { # First establish the FTP session $WinSCPConParams = @{ @@ -247,6 +251,7 @@ function Connect-To { Protocol = 'Ftp' FtpMode = 'Passive' } + try { $FTPSessionOption = New-WinSCPSessionOption @WinSCPConParams $global:WinSCPSession = New-WinSCPSession -SessionOption $FTPSessionOption @@ -263,6 +268,7 @@ function Connect-To { Write-Error -Message $m } } + 'NetAppFAS' { # Construct the splatting for Connect-NcController $params = @{ @@ -290,6 +296,7 @@ function Connect-To { return $handle } } + 'NetAppSGWS' { # Construct the splatting for Connect-SgwServer $params = @{ @@ -317,6 +324,7 @@ function Connect-To { return $SgwSession } } + 'SCP' { $WinSCPSessionParams = @{ Credential = $creds @@ -343,6 +351,7 @@ function Connect-To { Write-Error -Message $m } } + 'VMware' { try { 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) } } + 'VMwareCisServer' { try { if ($PassThru.IsPresent) { @@ -368,10 +378,6 @@ function Connect-To { 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) - } } } }