Files
syno-scripts/Powershell/Shutdown_V2/Modules/VCenter.md
T

16 lines
366 B
Markdown
Executable File

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