function Connect-ToVCenter { param( [string]$Server, [pscredential]$Credential ) ``` Import-Module VMware.PowerCLI -ErrorAction Stop Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false | Out-Null Connect-VIServer -Server $Server -Credential $Credential -ErrorAction Stop | Out-Null ``` }