vmware / PowerCLI-Example-Scripts

http://blogs.vmware.com/powercli
Other
764 stars 608 forks source link

VMware.HV.Helper.psm1 - Start-HVPool removes existing vTPM from a desktop pool #586

Closed Geo-Ron closed 2 years ago

Geo-Ron commented 2 years ago

Describe the bug

Using Start-HVPool to schedule a new image push to a desktop pool removes the vTPM if this already exists.

Before: image image
After: image image

This, in my opinion, is unwanted behaviour and changes settings on the desktop pool.

Reproduction steps

$HVPoolParams = @{
    SchedulePushImage = $true
    Pool              = $PoolName
    LogoffSetting     = 'WAIT_FOR_LOGOFF'
    ParentVM          = $TargetImage
    SnapshotVM        = $targetSnapshot
    Confirm           = $false
    ErrorAction       = 'Stop'
}
Start-HVPool @HVPoolParams

Expected behavior

the expection was that the vTPM remained enabled on the desktop pool. This is not the case.

Additional context

The setting 'AddVirtualTPM' remains empty at line 7124 in the variable property $spec.Settings. Since it is not retrieved from the current pool setting, it results in removal of that property

Geo-Ron commented 2 years ago

Code change is merged, so this should solve the issue...