The New-GCPolicy and New-GCPolicyFile should validate the parameters provided are valid for the package targeted.
The package should be downloaded and inspected to make sure the parameters are valid.
We could use the same validation with Get/Start commands.
Here's a few ideas on how to implement this:
Use the private function Get-GuestConfigurationPackageFromUri to download the package to Temp folder. It will return the zip path.
Extract the zip file and read the mof (look at Get-GuestConfigurationPackageNameFromZip for extraction, then [DscClassCache]::ImportInstances($Path,4)).
Validate the parameters against the DSC resources you found in the mof, each parameter must have a match.
The New-GCPolicy and New-GCPolicyFile should validate the parameters provided are valid for the package targeted.
The package should be downloaded and inspected to make sure the parameters are valid. We could use the same validation with Get/Start commands.
Here's a few ideas on how to implement this:
Get-GuestConfigurationPackageFromUri
to download the package to Temp folder. It will return the zip path.Get-GuestConfigurationPackageNameFromZip
for extraction, then[DscClassCache]::ImportInstances($Path,4)
).