You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make sure you are able to repro it on the latest version
Search the existing issues.
Summary
I have a configuration with a collection of Microsoft.DSC/PowerShell/Microsoft.WinGet.DSC/WinGetPackage. With 15 resources I get an error. With 14 it reliably works. It doesn't matter what parameters are in the 15th.
Name Value
---------
PSVersion 7.5.0
PSEdition Core
GitCommitId 7.5.0
OS Microsoft Windows 10.0.22621
Platform Win32NT
PSCompatibleVersions {1.0,2.0,3.0,4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Version
3.0.0-rc.1
Visuals
No response
The text was updated successfully, but these errors were encountered:
Interesting @cdhunt. I don't think it has particular have to do with the fact how many resources you've defined. Instead, it's the underlying modules installed that breaks the script.
Basically, if you follow the breadcrumbs on the adapter that's executing it, the lookup table that's being built, probably will contain 14 cache resource for you (for me it was 13).
Looking at the error message, I think the checking that happens might be incorrect, but this is an assumption. @SteveL-MSFT or @anmenaga, changing the code in the powershell.resource.ps1 from this:
# only need to cache the resources that are used$dscResourceModules=$desiredState|ForEach-Object { $_.Type.Split('/')[0] }
if ($null-eq$dscResourceModules) {
$trace=@{'Debug'='ERROR: Could not get list of DSC resource types from provided JSON.' } |ConvertTo-Json-Compress
$host.ui.WriteErrorLine($trace)
exit1
}
$dscResourceCache=Invoke-DscCacheRefresh-module $dscResourceModulesif ($dscResourceCache.count-lt$dscResourceModules.count) {
$trace=@{'Debug'='ERROR: DSC resource module not found.' } |ConvertTo-Json-Compress
$host.ui.WriteErrorLine($trace)
exit1
}
To:
# only need to cache the resources that are used$dscResourceModules=$desiredState|ForEach-Object { $_.Type.Split('/')[0] }
$moduleInput=$desiredState|Select-Object-ExpandProperty Type |Sort-Object-Unique
if ($null-eq$dscResourceModules) {
$trace=@{'Debug'='ERROR: Could not get list of DSC resource types from provided JSON.' } |ConvertTo-Json-Compress
$host.ui.WriteErrorLine($trace)
exit1
}
$dscResourceCache=Invoke-DscCacheRefresh-module $dscResourceModules$moduleInput|Foreach-Object {
if ($dscResourceCache.Type-notcontains$_) {
$trace=@{'Debug'='ERROR: DSC resource module not found.' } |ConvertTo-Json-Compress
$host.ui.WriteErrorLine($trace)
exit1
}
}
Does the validation that was being looked for I guess. If you want me to hit up a PR on it, just let me know.
Prerequisites
Summary
I have a configuration with a collection of Microsoft.DSC/PowerShell/Microsoft.WinGet.DSC/WinGetPackage. With 15 resources I get an error. With 14 it reliably works. It doesn't matter what parameters are in the 15th.
Steps to reproduce
dsc config get -f C:\Users\chunt\desktop.dsc.yml
Config and trace output: https://gist.github.com/cdhunt/48ccd50d822da6a8bf24e8b50f8272fc
Expected behavior
Expect to get a results collection.
Actual behavior
`ERROR dsc::subcommand: 68: Command: Resource 'pwsh' [exit code 1] manifest description: Error`
Error details
`ERROR dsc::subcommand: 68: Command: Resource 'pwsh' [exit code 1] manifest description: Error`
Environment data
Version
3.0.0-rc.1
Visuals
No response
The text was updated successfully, but these errors were encountered: