Skip to content

Commit 91e5a19

Browse files
author
Jaromir Kaspar
authored
Merge pull request #427 from microsoft/dev
Dev
2 parents e152103 + 1f189d4 commit 91e5a19

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Scripts/3_Deploy.ps1

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff 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"

0 commit comments

Comments
 (0)