Open eehret opened 7 months ago
FYI my workaround for this was to NOT follow the example in this article (https://learn.microsoft.com/en-us/azure/governance/machine-configuration/how-to/create-policy-definition?source=recommendations#policy-lifecycle) and using underscores (_) in the package name instead of periods (.)
Sorry, mistakenly hit the close button.
Details of the scenario you tried and the problem that is occurring
The GuestConfiguration module errors out if the guest configuration package filename specified to
New-GuestConfigurationPackage
(by theName
parameter) includes periods in the package name. When the Guest Configuration package contains periods in the package name then the MOF file inside of the ZIP also includes periods in the filename, and when attempting to use the package with theGet-GuestConfigurationPackageComplianceStatus
command , Guest Configuration mishandles this and tries to find the MOF using the wrong path.This is particularly problematic because the guidance found here specifically suggests a package naming convention that will lead to users encountering this error condition: https://learn.microsoft.com/en-us/azure/governance/machine-configuration/how-to/create-policy-definition?source=recommendations#policy-lifecycle
Verbose logs showing the problem
Suggested solution to the issue
It looks like the GuestConfiguration code is making a bad assumption regarding periods being in the filename, and parsing based on that bad assumption. I assume the related code for parsing the path of the MOF needs revising.
The DSC configuration that is used to reproduce the issue (if applicable)
n/a - this issue is not configuration-dependent
The operating system the target node is running
Ubuntu Server 18.04 LTS
Version and build of PowerShell the target node is running
7.3.10 (7.4+ doesn't seem to work with GuestConfiguration, so we have intentionally avoided upgrading)
Version of the module that was used
4.5.0