Skip to content

Commit 70aca2b

Browse files
authored
Merge pull request #78 from jdustin1/master
Adding warning/return when connected to multiple vCenters
2 parents 2b4ff6c + 5d6bd90 commit 70aca2b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

powershell/ESXiDisableProtocolConfiguration.ps1

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
)
2323

2424
$debug = $false
25+
if ( $global:DefaultVIServers.Count -ne 1 ) {
26+
write-error "Need to be connected to exactly ONE vCenter. Please try again"
27+
return
28+
}
2529

2630
Function Get-SFCBDConf {
2731
param(
@@ -139,6 +143,10 @@ Function Set-ESXiDPC {
139143
[Parameter(Mandatory=$true)][Boolean]$TLS1_2,
140144
[Parameter(Mandatory=$true)][Boolean]$SSLV3
141145
)
146+
if ( $global:DefaultVIServers.Count -ne 1 ) {
147+
write-error "Need to be connected to exactly ONE vCenter. Please try again"
148+
return
149+
}
142150

143151
Function UpdateSFCBConfig {
144152
param(

0 commit comments

Comments
 (0)