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 am experience a strange problem whenever I tried executing the Microsoft.DSC/PowerShell resource. I have the following file winget_dsc.config.yml modified from the examples:
When I execute it, I get the following error message:
Steps to reproduce
Use Install-Module -Name Microsoft.WinGet.DSC -Scope AllUsers and Install-PSResource -Name Microsoft.WinGet.DSC -Scope AllUsers
Create the YAML configuration file in the description above
Execute dsc config set --path winget_dsc.config.yaml
Expected behavior
I would have expected the cache refreshing to filter out the latest DSC module it tries to return in the following lines:foreach ($member in $typeDefinitionAst.Members) { $property = $member -as [System.Management.Automation.Language.PropertyMemberAst] if (($property -eq $null) -or ($property.IsStatic)) { continue; } $skipProperty = $true $isKeyProperty = $false foreach ($attr in $property.Attributes) { if ($attr.TypeName.Name -eq 'DscProperty') { $skipProperty = $false foreach ($attrArg in $attr.NamedArguments) { if ($attrArg.ArgumentName -eq 'Key') { $isKeyProperty = $true } } } } if ($skipProperty) { continue; } [DscResourcePropertyInfo]$prop = [DscResourcePropertyInfo]::new() $prop.Name = $property.Name $prop.PropertyType = $property.PropertyType.TypeName.Name $prop.IsMandatory = $isKeyProperty $DscResourceInfo.Properties.Add($prop)}$resourceList.Add($DscResourceInfo)
Actual behavior
Throws an error if multiple modules are available.
Error details
No response
Environment data
Name Value
---------
PSVersion 7.4.1
PSEdition Core
GitCommitId 7.4.1
OS Microsoft Windows 10.0.19045
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-preview.8
Visuals
No response
The text was updated successfully, but these errors were encountered:
I can't repro this exact error message; but I see in the cache that not the latest version is selected if there are several versions of the module installed; This probably needs to be fixed to use the latest version.
How are you able to install Microsoft.WinGet.DSC module without -AllowPrerelease flag? At this moment looks like they have only -alpha versions on PSGallery...
please rerun with -l trace (i.e. dsc -l trace config set --path winget_dsc.config.yaml) and share the output;
please share the output of get-module -ListAvailable -Name Microsoft.WinGet.DSC | Format-List
I can't repro this exact error message; but I see in the cache that not the latest version is selected if there are several versions of the module installed; This probably needs to be fixed to use the latest version.
How are you able to install Microsoft.WinGet.DSC module without -AllowPrerelease flag? At this moment looks like they have only -alpha versions on PSGallery...
please rerun with -l trace (i.e. dsc -l trace config set --path winget_dsc.config.yaml) and share the output;
please share the output of get-module -ListAvailable -Name Microsoft.WinGet.DSC | Format-List
Hi Andrew,
In the steps to reproduce section, I used both Install-Module -Name Microsoft.WinGet.DSC -Scope AllUsers on Windows PowerShell and Install-PSResource -Name Microsoft.WinGet.DSC -Scope AllUsers.
Prerequisites
Summary
I am experience a strange problem whenever I tried executing the
Microsoft.DSC/PowerShell
resource. I have the following file winget_dsc.config.yml modified from the examples:When I execute it, I get the following error message:
Steps to reproduce
dsc config set --path winget_dsc.config.yaml
Expected behavior
Actual behavior
Throws an error if multiple modules are available.
Error details
No response
Environment data
Version
3.0.0-preview.8
Visuals
No response
The text was updated successfully, but these errors were encountered: