File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -1532,7 +1532,12 @@ If (-not $isAdmin) {
15321532 # Enable Guest services on all VMs if integration component if configured
15331533 if ($labconfig.EnableGuestServiceInterface ){
15341534 WriteInfo " `t Enabling Guest Service Interface"
1535- Get-VM - VMName " $ ( $labconfig.Prefix ) *" | Where-Object {$_.state -eq " Running" -or $_.state -eq " Off" } | Enable-VMIntegrationService - Name " Guest Service Interface"
1535+ $vms = Get-VM - VMName " $ ( $labconfig.Prefix ) *" | Where-Object {$_.state -eq " Running" -or $_.state -eq " Off" }
1536+ foreach ($vm in $vms ) {
1537+ $guestServiceId = ' Microsoft:{0}\6C09BB55-D683-4DA0-8931-C9BF705F6480' -f $vm.Id
1538+ $guestService = $vm | Get-VMIntegrationService | Where-Object - FilterScript {$_.Id -eq $guestServiceId }
1539+ $guestService | Enable-VMIntegrationService
1540+ }
15361541 $TempVMs = Get-VM - VMName " $ ( $labconfig.Prefix ) *" | Where-Object {$_.state -ne " Running" -and $_.state -ne " Off" }
15371542 if ($TempVMs ){
15381543 WriteInfoHighlighted " `t`t Following VMs cannot be configured, as the state is not running or off"
You can’t perform that action at this time.
0 commit comments