Skip to content

dsc resource list --adapter Microsoft.DSC/PowerShell fails to list #639

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 tasks done
cdhunt opened this issue Feb 11, 2025 · 3 comments
Closed
3 tasks done

dsc resource list --adapter Microsoft.DSC/PowerShell fails to list #639

cdhunt opened this issue Feb 11, 2025 · 3 comments
Labels
Issue-Bug Something isn't working Need-Review

Comments

@cdhunt
Copy link

cdhunt commented Feb 11, 2025

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.

Summary

I expect to be able to list installed PowerShell DSC resources with the DSC cli but the command fails.

dsc resource list --adapter Microsoft.DSC/PowerShell
2025-02-11T13:52:36.084996Z  WARN Command: Resource 'pwsh' [exit code 1] manifest description: Error

Steps to reproduce

dsc resource list --adapter Microsoft.DSC/PowerShell

Image

Expected behavior

I expect a list of PowerShell DSC resources.

Actual behavior

An empty list with headers and a warning.

Error details

"WARN Command: Resource 'pwsh' [exit code 1] manifest description: Error"

Environment data

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

Image

@cdhunt cdhunt added Issue-Bug Something isn't working Need-Review labels Feb 11, 2025
@Gijsreyn
Copy link
Contributor

Can you turn on the trace level as such: dsc --trace-level trace resource list --adapter Microsoft.DSC/PowerShell and dump in the logging @cdhunt ?

@cdhunt
Copy link
Author

cdhunt commented Feb 11, 2025

Here you go

2025-02-11T15:44:00.576884Z  INFO dsc::util: 417: Trace-level is Trace
2025-02-11T15:44:00.577466Z DEBUG dsc: 42: Running DSC version: 3.0.0-rc.1
2025-02-11T15:44:00.578604Z TRACE dsc_lib::discovery::command_discovery: 368: Listing resources with type_name_filter '*' and adapter_name_filter 'Microsoft.DSC/PowerShell'
2025-02-11T15:44:00.579547Z  INFO dsc_lib::discovery::command_discovery: 173: Discovering resources using filter: *
2025-02-11T15:44:00.580261Z DEBUG dsc_lib::discovery::command_discovery: 176: Using regex ^.*?$ as filter for adapter name
2025-02-11T15:44:00.584028Z DEBUG dsc_lib::util: 188: Found setting 'resourcePath' in C:\bin\DSC\dsc_default.settings.json
2025-02-11T15:44:00.585705Z DEBUG dsc_lib::util: 198: Found setting 'resourcePath' in C:\bin\DSC\dsc.settings.json
2025-02-11T15:44:00.587131Z DEBUG dsc_lib::util: 212: Setting 'resourcePath' not found in C:\ProgramData\dsc\dsc.settings.json
2025-02-11T15:44:00.588253Z DEBUG dsc_lib::discovery::command_discovery: 122: Appending PATH to resourcePath
2025-02-11T15:44:00.589108Z TRACE dsc_lib::discovery::command_discovery: 125: Original PATH:***
2025-02-11T15:44:00.591240Z TRACE dsc_lib::discovery::command_discovery: 144: Exe home is already in path: C:\bin\DSC
2025-02-11T15:44:00.592115Z DEBUG dsc_lib::discovery::command_discovery: 157: Using Resource Path: ***
2025-02-11T15:44:02.698696Z TRACE dsc_lib::discovery::command_discovery: 233: Resource 'Microsoft.DSC/Assertion' found
2025-02-11T15:44:02.701456Z TRACE dsc_lib::discovery::command_discovery: 212: Found resource manifest: C:\bin\DSC\echo.dsc.resource.json
2025-02-11T15:44:02.703118Z TRACE dsc_lib::discovery::command_discovery: 233: Resource 'Microsoft.DSC.Debug/Echo' found
2025-02-11T15:44:02.704233Z TRACE dsc_lib::discovery::command_discovery: 212: Found resource manifest: C:\bin\DSC\group.dsc.resource.json
2025-02-11T15:44:02.706333Z TRACE dsc_lib::discovery::command_discovery: 233: Resource 'Microsoft.DSC/Group' found
2025-02-11T15:44:02.708105Z TRACE dsc_lib::discovery::command_discovery: 212: Found resource manifest: C:\bin\DSC\osinfo.dsc.resource.json
2025-02-11T15:44:02.710424Z TRACE dsc_lib::discovery::command_discovery: 233: Resource 'Microsoft/OSInfo' found
2025-02-11T15:44:02.712587Z TRACE dsc_lib::discovery::command_discovery: 212: Found resource manifest: C:\bin\DSC\powershell.dsc.resource.json
2025-02-11T15:44:02.714438Z TRACE dsc_lib::discovery::command_discovery: 230: Resource adapter 'Microsoft.DSC/PowerShell' found
2025-02-11T15:44:02.715898Z TRACE dsc_lib::discovery::command_discovery: 212: Found resource manifest: C:\bin\DSC\reboot_pending.dsc.resource.json
2025-02-11T15:44:02.717486Z TRACE dsc_lib::discovery::command_discovery: 233: Resource 'Microsoft.Windows/RebootPending' found
2025-02-11T15:44:02.718904Z TRACE dsc_lib::discovery::command_discovery: 212: Found resource manifest: C:\bin\DSC\registry.dsc.resource.json
2025-02-11T15:44:02.720878Z TRACE dsc_lib::discovery::command_discovery: 233: Resource 'Microsoft.Windows/Registry' found
2025-02-11T15:44:02.722582Z TRACE dsc_lib::discovery::command_discovery: 212: Found resource manifest: C:\bin\DSC\RunCommandOnSet.dsc.resource.json
2025-02-11T15:44:02.724374Z TRACE dsc_lib::discovery::command_discovery: 233: Resource 'Microsoft.DSC.Transitional/RunCommandOnSet' found
2025-02-11T15:44:02.726105Z TRACE dsc_lib::discovery::command_discovery: 212: Found resource manifest: C:\bin\DSC\windowspowershell.dsc.resource.json
2025-02-11T15:44:02.729815Z TRACE dsc_lib::discovery::command_discovery: 230: Resource adapter 'Microsoft.Windows/WindowsPowerShell' found
2025-02-11T15:44:02.731649Z TRACE dsc_lib::discovery::command_discovery: 212: Found resource manifest: C:\bin\DSC\wmi.dsc.resource.json
2025-02-11T15:44:02.733535Z TRACE dsc_lib::discovery::command_discovery: 230: Resource adapter 'Microsoft.Windows/WMI' found
2025-02-11T15:44:02.734620Z DEBUG dsc_lib::discovery::command_discovery: 244: Found 7 matching non-adapter-based resources
2025-02-11T15:44:02.735849Z DEBUG dsc_lib::discovery::command_discovery: 260: Using regex ^Microsoft\.DSC/PowerShell$ as filter for adapter name
2025-02-11T15:44:02.736498Z DEBUG dsc_lib::discovery::command_discovery: 268: Using regex ^.*?$ as filter for resource name
2025-02-11T15:44:02.738025Z  INFO dsc_lib::discovery::command_discovery: 295: Enumerating resources for adapter 'Microsoft.DSC/PowerShell'
2025-02-11T15:44:02.739703Z DEBUG dsc_lib::dscresources::command_resource: 672: Invoking command 'pwsh' with args Some(["-NoLogo", "-NonInteractive", "-NoProfile", "-Command", "./psDscAdapter/powershell.resource.ps1 List"])
2025-02-11T15:44:03.969798Z TRACE dsc_lib::dscresources::command_resource: 875: PID 46064: ./psDscAdapter/powershell.resource.ps1: AuthorizationManager check failed.
2025-02-11T15:44:04.210625Z DEBUG dsc_lib::dscresources::command_resource: 633: Process 'pwsh' id 46064 exited with code 1
2025-02-11T15:44:04.212949Z  WARN dsc_lib::discovery::command_discovery: 320: Command: Resource 'pwsh' [exit code 1] manifest description: Error
2025-02-11T15:44:04.216319Z DEBUG dsc_lib::discovery::command_discovery: 667: Read 14 items into lookup table from "C:\\Users\\chunt\\AppData\\Local\\dsc\\AdaptedResourcesLookupTable.json"

@cdhunt
Copy link
Author

cdhunt commented Feb 11, 2025

With that output I found #539 and that fixed the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug Something isn't working Need-Review
Projects
None yet
Development

No branches or pull requests

2 participants