vmware / dscr-for-vmware

The Repository contains Microsoft PowerShell Desired State Configuration (DSC) Resources for managing VC and ESXi settings.
Other
139 stars 41 forks source link

[Bug fix] Extend key property validation with null check in VMware.PSDesiredStateConfiguration #314

Closed dmilov closed 3 years ago

dmilov commented 3 years ago

Changed

vmwclabot commented 3 years ago

@dmilov, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <john.doe@email.org> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

SimeonGerginov commented 3 years ago

Moving the Testing Done comment here, as the PR Description is merged to the CHANGELOG.md document:

Testing done:

> $config = New-VmwDscConfiguration VMHost_Network_Config
> Start-VmwDscConfiguration $config
Exception: C:\Temp\DSCTest\Modules\VMware.PSDesiredStateConfiguration\Classes\DscItems.ps1:1458
Line |
1458 |  …             throw "Incorrect DSC Configuration: Key Property '$dscKey …
     |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Incorrect DSC Configuration: Key Property 'VMHostName' of resource [VMHostVssNic]VMHostVssNic is NULL
> $config = New-VmwDscConfiguration VMHost_Network_Config
> . C:\Temp\DSCConfigs\VCESXConfig.ps1
> $config = New-VmwDscConfiguration VMHost_Network_Config
> Start-VmwDscConfiguration $config
>