Other loop for "Remove all existing NTP Servers"
This commit is contained in:
@@ -77,8 +77,8 @@ function Set-VMHostSecureNTP {
|
|||||||
## Remove all existing NTP Servers
|
## Remove all existing NTP Servers
|
||||||
"Remove all existing NTP Servers ..."
|
"Remove all existing NTP Servers ..."
|
||||||
try {
|
try {
|
||||||
foreach ($OldNtpServer in ($MyHost | Get-VMHostNtpServer)) {
|
$MyHost | Get-VMHostNtpServer | Foreach-Object {
|
||||||
$MyHost | Remove-VMHostNtpServer -NtpServer $OldNtpServer -Confirm:$false
|
Remove-VMHostNtpServer -VMHost $MyHost -NtpServer $_ -Confirm:$false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch [System.Exception] {
|
catch [System.Exception] {
|
||||||
|
|||||||
Reference in New Issue
Block a user