Attempting to use a PowerShell DSC resource fails with a RuntimeException

Abierto
#1,786 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
powershell, rust
Área
backend, cli

Línea de trabajo

Start by tracing the PowerShell adapter path used by dsc resource list -a Microsoft.Adapter/PowerShell and inspect the parsing error in the debug output. Reproduce with the provided class based resource under PowerShell 7, then compare the adapter’s behavior with Get-DscResource; done when the adapter lists the sample resource without the RuntimeException.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Issue-Bug Need-Review
Prerequisites
  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.
Summary

I'm trying to create a class based PowerShell resource to migrate over some of our logic, but I cannot get it to show up through the adapter, because it errors out when trying to parse it. It works with the PSDesiredStateConfiguration module in PowerShell 7, so it should be valid.

Steps to reproduce
  1. Create a PowerShell module somewhere under PSModulePath, with the following manifest:
@{
    ModuleVersion = '1.0'
    GUID = '796aed88-af35-4f32-92d6-80079ccc04bf'
    Author = 'Sample'
    NestedModules = @("SampleResource.psm1")
    FunctionsToExport = @()
    CmdletsToExport = @()
    VariablesToExport = '*'
    DscResourcesToExport = @("SampleResource")
}
  1. In the module, create SampleResource.psm1 with the following content:
[DscResource()]
class SampleResource {
    [DscProperty(Key)]
    [string]$Key

    [bool] Test() {
        return $false
    }

    [SampleResource] Get() {
        return $this
    }

    [void] Set() {

    }
}
  1. Confirm it shows up with Get-DscResource under PowerShell 7.
Expected behavior
dsc resource list -a Microsoft.Adapter/PowerShell

shows the sample resource
Actual behavior
dsc -l debug resource list -a Microsoft.Adapter/PowerShell
2026-11-05T12:59:44.692632Z  INFO dsc::util: 426: Trace-level is Debug
2026-11-05T12:59:44.693551Z DEBUG dsc: 90: Running DSC version: 3.4.0-preview.2
2026-11-05T12:59:44.695667Z  INFO dsc_lib::discovery::command_discovery: 241: Discovering 'Extension' using filter: *
2026-11-05T12:59:44.696040Z DEBUG dsc_lib::discovery::command_discovery: 243: Using type name filter '*' for adapter name
2026-11-05T12:59:44.698724Z DEBUG dsc_lib::util: 199: Found setting 'resourcePath' in C:\Tieto\DSC\bin\dsc_default.settings.json
2026-11-05T12:59:44.699661Z DEBUG dsc_lib::util: 209: Found setting 'resourcePath' in C:\Tieto\DSC\bin\dsc.settings.json
2026-11-05T12:59:44.700452Z DEBUG dsc_lib::util: 223: Setting 'resourcePath' not found in C:\ProgramData\dsc\dsc.settings.json
2026-11-05T12:59:44.701672Z DEBUG dsc_lib::discovery::command_discovery: 170: Appending PATH to resourcePath
2026-11-05T12:59:44.702858Z DEBUG dsc_lib::discovery::command_discovery: 191: Using Resource Path: C:\Tieto\DSC\bin\;C:\Program Files\PowerShell\7;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\Microsoft SQL Server\170\Tools\Binn\;C:\Program Files\Microsoft SQL Server\170\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\180\Tools\Binn\;C:\Program Files\Microsoft SQL Server\170\DTS\Binn\;C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps;
2026-11-05T12:59:44.708665Z DEBUG dsc_lib::parser: 48: Parsing statement: [not(equals(tryWhich('pwsh'), null()))]
2026-11-05T12:59:44.709595Z DEBUG dsc_lib::parser: 94: Parsing expression
2026-11-05T12:59:44.710305Z DEBUG dsc_lib::parser::expressions: 49: Parsing function: "not(equals(tryWhich('pwsh'), null()))"
2026-11-05T12:59:44.711238Z DEBUG dsc_lib::parser::expressions: 49: Parsing function: "equals(tryWhich('pwsh'), null())"
2026-11-05T12:59:44.712148Z DEBUG dsc_lib::parser::expressions: 49: Parsing function: "tryWhich('pwsh')"
2026-11-05T12:59:44.712803Z DEBUG dsc_lib::parser::functions: 99: Function name: 'tryWhich'
2026-11-05T12:59:44.713432Z DEBUG dsc_lib::parser::expressions: 49: Parsing function: "null()"
2026-11-05T12:59:44.714343Z DEBUG dsc_lib::parser::functions: 99: Function name: 'null'
2026-11-05T12:59:44.715129Z DEBUG dsc_lib::parser::functions: 99: Function name: 'equals'
2026-11-05T12:59:44.715999Z DEBUG dsc_lib::parser::functions: 99: Function name: 'not'
2026-11-05T12:59:44.716729Z DEBUG dsc_lib::parser::functions: 127: Argument is an expression
2026-11-05T12:59:44.717425Z DEBUG dsc_lib::parser::functions: 127: Argument is an expression
2026-11-05T12:59:44.718295Z DEBUG dsc_lib::parser::functions: 132: Argument is a value: 'String("pwsh")'
2026-11-05T12:59:44.718907Z DEBUG dsc_lib::functions::try_which: 35: tryWhich function
2026-11-05T12:59:44.720214Z DEBUG dsc_lib::parser::functions: 127: Argument is an expression
2026-11-05T12:59:44.720958Z DEBUG dsc_lib::functions::null: 31: null function
2026-11-05T12:59:44.721845Z DEBUG dsc_lib::functions::not: 31: not function
2026-11-05T12:59:44.840678Z  INFO dsc_lib::discovery::command_discovery: 241: Discovering 'Resource' using filter: *
2026-11-05T12:59:44.841075Z DEBUG dsc_lib::discovery::command_discovery: 243: Using type name filter '*' for adapter name
2026-11-05T12:59:44.842411Z DEBUG dsc_lib::util: 199: Found setting 'resourcePath' in C:\Tieto\DSC\bin\dsc_default.settings.json
2026-11-05T12:59:44.843365Z DEBUG dsc_lib::util: 209: Found setting 'resourcePath' in C:\Tieto\DSC\bin\dsc.settings.json
2026-11-05T12:59:44.844152Z DEBUG dsc_lib::util: 223: Setting 'resourcePath' not found in C:\ProgramData\dsc\dsc.settings.json
2026-11-05T12:59:44.844740Z DEBUG dsc_lib::discovery::command_discovery: 170: Appending PATH to resourcePath
2026-11-05T12:59:44.845498Z DEBUG dsc_lib::discovery::command_discovery: 191: Using Resource Path: C:\Tieto\DSC\bin\;C:\Program Files\PowerShell\7;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\Microsoft SQL Server\170\Tools\Binn\;C:\Program Files\Microsoft SQL Server\170\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\180\Tools\Binn\;C:\Program Files\Microsoft SQL Server\170\DTS\Binn\;C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps;
2026-11-05T12:59:44.851298Z DEBUG dsc_lib::parser: 48: Parsing statement: [not(equals(tryWhich('pwsh'), null()))]
2026-11-05T12:59:44.851984Z DEBUG dsc_lib::parser: 94: Parsing expression
2026-11-05T12:59:44.852546Z DEBUG dsc_lib::parser::expressions: 49: Parsing function: "not(equals(tryWhich('pwsh'), null()))"
2026-11-05T12:59:44.853086Z DEBUG dsc_lib::parser::expressions: 49: Parsing function: "equals(tryWhich('pwsh'), null())"
2026-11-05T12:59:44.853658Z DEBUG dsc_lib::parser::expressions: 49: Parsing function: "tryWhich('pwsh')"
2026-11-05T12:59:44.854180Z DEBUG dsc_lib::parser::functions: 99: Function name: 'tryWhich'
2026-11-05T12:59:44.854672Z DEBUG dsc_lib::parser::expressions: 49: Parsing function: "null()"
2026-11-05T12:59:44.855217Z DEBUG dsc_lib::parser::functions: 99: Function name: 'null'
2026-11-05T12:59:44.855770Z DEBUG dsc_lib::parser::functions: 99: Function name: 'equals'
2026-11-05T12:59:44.856382Z DEBUG dsc_lib::parser::functions: 99: Function name: 'not'
2026-11-05T12:59:44.856957Z DEBUG dsc_lib::parser::functions: 127: Argument is an expression
2026-11-05T12:59:44.857498Z DEBUG dsc_lib::parser::functions: 127: Argument is an expression
2026-11-05T12:59:44.858096Z DEBUG dsc_lib::parser::functions: 132: Argument is a value: 'String("pwsh")'
2026-11-05T12:59:44.858755Z DEBUG dsc_lib::functions::try_which: 35: tryWhich function
2026-11-05T12:59:44.859698Z DEBUG dsc_lib::parser::functions: 127: Argument is an expression
2026-11-05T12:59:44.860412Z DEBUG dsc_lib::functions::null: 31: null function
2026-11-05T12:59:44.861087Z DEBUG dsc_lib::functions::not: 31: not function
2026-11-05T12:59:44.864509Z DEBUG dsc_lib::parser: 48: Parsing statement: [not(equals(tryWhich('pwsh'), null()))]
2026-11-05T12:59:44.865536Z DEBUG dsc_lib::parser: 94: Parsing expression
2026-11-05T12:59:44.866356Z DEBUG dsc_lib::parser::expressions: 49: Parsing function: "not(equals(tryWhich('pwsh'), null()))"
2026-11-05T12:59:44.867222Z DEBUG dsc_lib::parser::expressions: 49: Parsing function: "equals(tryWhich('pwsh'), null())"
2026-11-05T12:59:44.867915Z DEBUG dsc_lib::parser::expressions: 49: Parsing function: "tryWhich('pwsh')"
2026-11-05T12:59:44.868569Z DEBUG dsc_lib::parser::functions: 99: Function name: 'tryWhich'
2026-11-05T12:59:44.869210Z DEBUG dsc_lib::parser::expressions: 49: Parsing function: "null()"
2026-11-05T12:59:44.869830Z DEBUG dsc_lib::parser::functions: 99: Function name: 'null'
2026-11-05T12:59:44.870565Z DEBUG dsc_lib::parser::functions: 99: Function name: 'equals'
2026-11-05T12:59:44.871306Z DEBUG dsc_lib::parser::functions: 99: Function name: 'not'
2026-11-05T12:59:44.871930Z DEBUG dsc_lib::parser::functions: 127: Argument is an expression
2026-11-05T12:59:44.872741Z DEBUG dsc_lib::parser::functions: 127: Argument is an expression
2026-11-05T12:59:44.873377Z DEBUG dsc_lib::parser::functions: 132: Argument is a value: 'String("pwsh")'
2026-11-05T12:59:44.874172Z DEBUG dsc_lib::functions::try_which: 35: tryWhich function
2026-11-05T12:59:44.875448Z DEBUG dsc_lib::parser::functions: 127: Argument is an expression
2026-11-05T12:59:44.876197Z DEBUG dsc_lib::functions::null: 31: null function
2026-11-05T12:59:44.877009Z DEBUG dsc_lib::functions::not: 31: not function
2026-11-05T12:59:44.879265Z DEBUG dsc_lib::parser: 48: Parsing statement: [not(equals(tryWhich('pwsh'), null()))]
2026-11-05T12:59:44.880048Z DEBUG dsc_lib::parser: 94: Parsing expression
2026-11-05T12:59:44.880730Z DEBUG dsc_lib::parser::expressions: 49: Parsing function: "not(equals(tryWhich('pwsh'), null()))"
2026-11-05T12:59:44.881333Z DEBUG dsc_lib::parser::expressions: 49: Parsing function: "equals(tryWhich('pwsh'), null())"
2026-11-05T12:59:44.881982Z DEBUG dsc_lib::parser::expressions: 49: Parsing function: "tryWhich('pwsh')"
2026-11-05T12:59:44.882589Z DEBUG dsc_lib::parser::functions: 99: Function name: 'tryWhich'
2026-11-05T12:59:44.883161Z DEBUG dsc_lib::parser::expressions: 49: Parsing function: "null()"
2026-11-05T12:59:44.883757Z DEBUG dsc_lib::parser::functions: 99: Function name: 'null'
2026-11-05T12:59:44.884350Z DEBUG dsc_lib::parser::functions: 99: Function name: 'equals'
2026-11-05T12:59:44.884933Z DEBUG dsc_lib::parser::functions: 99: Function name: 'not'
2026-11-05T12:59:44.885515Z DEBUG dsc_lib::parser::functions: 127: Argument is an expression
2026-11-05T12:59:44.886046Z DEBUG dsc_lib::parser::functions: 127: Argument is an expression
2026-11-05T12:59:44.886677Z DEBUG dsc_lib::parser::functions: 132: Argument is a value: 'String("pwsh")'
2026-11-05T12:59:44.887250Z DEBUG dsc_lib::functions::try_which: 35: tryWhich function
2026-11-05T12:59:44.888127Z DEBUG dsc_lib::parser::functions: 127: Argument is an expression
2026-11-05T12:59:44.889021Z DEBUG dsc_lib::functions::null: 31: null function
2026-11-05T12:59:44.889725Z DEBUG dsc_lib::functions::not: 31: not function
2026-11-05T12:59:44.898867Z DEBUG dsc_lib::parser: 48: Parsing statement: [not(equals(tryWhich('sshd'), null()))]
2026-11-05T12:59:44.899932Z DEBUG dsc_lib::parser: 94: Parsing expression
2026-11-05T12:59:44.900598Z DEBUG dsc_lib::parser::expressions: 49: Parsing function: "not(equals(tryWhich('sshd'), null()))"
2026-11-05T12:59:44.901099Z DEBUG dsc_lib::parser::expressions: 49: Parsing function: "equals(tryWhich('sshd'), null())"
2026-11-05T12:59:44.901552Z DEBUG dsc_lib::parser::expressions: 49: Parsing function: "tryWhich('sshd')"
2026-11-05T12:59:44.902169Z DEBUG dsc_lib::parser::functions: 99: Function name: 'tryWhich'
2026-11-05T12:59:44.902679Z DEBUG dsc_lib::parser::expressions: 49: Parsing function: "null()"
2026-11-05T12:59:44.903163Z DEBUG dsc_lib::parser::functions: 99: Function name: 'null'
2026-11-05T12:59:44.903640Z DEBUG dsc_lib::parser::functions: 99: Function name: 'equals'
2026-11-05T12:59:44.904321Z DEBUG dsc_lib::parser::functions: 99: Function name: 'not'
2026-11-05T12:59:44.905070Z DEBUG dsc_lib::parser::functions: 127: Argument is an expression
2026-11-05T12:59:44.905825Z DEBUG dsc_lib::parser::functions: 127: Argument is an expression
2026-11-05T12:59:44.906597Z DEBUG dsc_lib::parser::functions: 132: Argument is a value: 'String("sshd")'
2026-11-05T12:59:44.907383Z DEBUG dsc_lib::functions::try_which: 35: tryWhich function
2026-11-05T12:59:44.909239Z DEBUG dsc_lib::parser::functions: 127: Argument is an expression
2026-11-05T12:59:44.909928Z DEBUG dsc_lib::functions::null: 31: null function
2026-11-05T12:59:44.910501Z DEBUG dsc_lib::functions::not: 31: not function
2026-11-05T12:59:44.912215Z DEBUG dsc_lib::parser: 48: Parsing statement: [not(equals(tryWhich('sshd'), null()))]
2026-11-05T12:59:44.913053Z DEBUG dsc_lib::parser: 94: Parsing expression
2026-11-05T12:59:44.914201Z DEBUG dsc_lib::parser::expressions: 49: Parsing function: "not(equals(tryWhich('sshd'), null()))"
2026-11-05T12:59:44.915335Z DEBUG dsc_lib::parser::expressions: 49: Parsing function: "equals(tryWhich('sshd'), null())"
2026-11-05T12:59:44.916567Z DEBUG dsc_lib::parser::expressions: 49: Parsing function: "tryWhich('sshd')"
2026-11-05T12:59:44.917452Z DEBUG dsc_lib::parser::functions: 99: Function name: 'tryWhich'
2026-11-05T12:59:44.918256Z DEBUG dsc_lib::parser::expressions: 49: Parsing function: "null()"
2026-11-05T12:59:44.919127Z DEBUG dsc_lib::parser::functions: 99: Function name: 'null'
2026-11-05T12:59:44.919650Z DEBUG dsc_lib::parser::functions: 99: Function name: 'equals'
2026-11-05T12:59:44.920148Z DEBUG dsc_lib::parser::functions: 99: Function name: 'not'
2026-11-05T12:59:44.920878Z DEBUG dsc_lib::parser::functions: 127: Argument is an expression
2026-11-05T12:59:44.921682Z DEBUG dsc_lib::parser::functions: 127: Argument is an expression
2026-11-05T12:59:44.922519Z DEBUG dsc_lib::parser::functions: 132: Argument is a value: 'String("sshd")'
2026-11-05T12:59:44.923332Z DEBUG dsc_lib::functions::try_which: 35: tryWhich function
2026-11-05T12:59:44.924948Z DEBUG dsc_lib::parser::functions: 127: Argument is an expression
2026-11-05T12:59:44.926257Z DEBUG dsc_lib::functions::null: 31: null function
2026-11-05T12:59:44.927402Z DEBUG dsc_lib::functions::not: 31: not function
2026-11-05T12:59:44.928994Z DEBUG dsc_lib::parser: 48: Parsing statement: [not(equals(tryWhich('sshd'), null()))]
2026-11-05T12:59:44.930052Z DEBUG dsc_lib::parser: 94: Parsing expression
2026-11-05T12:59:44.930960Z DEBUG dsc_lib::parser::expressions: 49: Parsing function: "not(equals(tryWhich('sshd'), null()))"
2026-11-05T12:59:44.931728Z DEBUG dsc_lib::parser::expressions: 49: Parsing function: "equals(tryWhich('sshd'), null())"
2026-11-05T12:59:44.932390Z DEBUG dsc_lib::parser::expressions: 49: Parsing function: "tryWhich('sshd')"
2026-11-05T12:59:44.933097Z DEBUG dsc_lib::parser::functions: 99: Function name: 'tryWhich'
2026-11-05T12:59:44.933688Z DEBUG dsc_lib::parser::expressions: 49: Parsing function: "null()"
2026-11-05T12:59:44.934382Z DEBUG dsc_lib::parser::functions: 99: Function name: 'null'
2026-11-05T12:59:44.935312Z DEBUG dsc_lib::parser::functions: 99: Function name: 'equals'
2026-11-05T12:59:44.936146Z DEBUG dsc_lib::parser::functions: 99: Function name: 'not'
2026-11-05T12:59:44.937091Z DEBUG dsc_lib::parser::functions: 127: Argument is an expression
2026-11-05T12:59:44.937575Z DEBUG dsc_lib::parser::functions: 127: Argument is an expression
2026-11-05T12:59:44.938135Z DEBUG dsc_lib::parser::functions: 132: Argument is a value: 'String("sshd")'
2026-11-05T12:59:44.938627Z DEBUG dsc_lib::functions::try_which: 35: tryWhich function
2026-11-05T12:59:44.939844Z DEBUG dsc_lib::parser::functions: 127: Argument is an expression
2026-11-05T12:59:44.940427Z DEBUG dsc_lib::functions::null: 31: null function
2026-11-05T12:59:44.941032Z DEBUG dsc_lib::functions::not: 31: not function
2026-11-05T12:59:44.942452Z DEBUG dsc_lib::parser: 48: Parsing statement: [not(equals(tryWhich('sshd'), null()))]
2026-11-05T12:59:44.943015Z DEBUG dsc_lib::parser: 94: Parsing expression
2026-11-05T12:59:44.943530Z DEBUG dsc_lib::parser::expressions: 49: Parsing function: "not(equals(tryWhich('sshd'), null()))"
2026-11-05T12:59:44.944066Z DEBUG dsc_lib::parser::expressions: 49: Parsing function: "equals(tryWhich('sshd'), null())"
2026-11-05T12:59:44.944717Z DEBUG dsc_lib::parser::expressions: 49: Parsing function: "tryWhich('sshd')"
2026-11-05T12:59:44.945307Z DEBUG dsc_lib::parser::functions: 99: Function name: 'tryWhich'
2026-11-05T12:59:44.946455Z DEBUG dsc_lib::parser::expressions: 49: Parsing function: "null()"
2026-11-05T12:59:44.947224Z DEBUG dsc_lib::parser::functions: 99: Function name: 'null'
2026-11-05T12:59:44.947942Z DEBUG dsc_lib::parser::functions: 99: Function name: 'equals'
2026-11-05T12:59:44.948691Z DEBUG dsc_lib::parser::functions: 99: Function name: 'not'
2026-11-05T12:59:44.949488Z DEBUG dsc_lib::parser::functions: 127: Argument is an expression
2026-11-05T12:59:44.950666Z DEBUG dsc_lib::parser::functions: 127: Argument is an expression
2026-11-05T12:59:44.951347Z DEBUG dsc_lib::parser::functions: 132: Argument is a value: 'String("sshd")'
2026-11-05T12:59:44.952028Z DEBUG dsc_lib::functions::try_which: 35: tryWhich function
2026-11-05T12:59:44.953608Z DEBUG dsc_lib::parser::functions: 127: Argument is an expression
2026-11-05T12:59:44.954372Z DEBUG dsc_lib::functions::null: 31: null function
2026-11-05T12:59:44.955090Z DEBUG dsc_lib::functions::not: 31: not function
2026-11-05T12:59:45.055180Z DEBUG dsc_lib::discovery::command_discovery: 339: Calling extension 'Microsoft.PowerShell/Discover' to discover resources
2026-11-05T12:59:45.564774Z DEBUG dsc_lib::dscresources::command_resource: 912: Process 'pwsh' id 2412 exited with code 0
2026-11-05T12:59:45.566246Z  INFO dsc_lib::extensions::discover: 114: No results returned for discovery extension 'Microsoft.PowerShell/Discover'
2026-11-05T12:59:45.566976Z DEBUG dsc_lib::discovery::command_discovery: 347: Extension 'Microsoft.PowerShell/Discover' found 0 resources
2026-11-05T12:59:45.567649Z DEBUG dsc_lib::discovery::command_discovery: 339: Calling extension 'Microsoft.Windows.Appx/Discover' to discover resources
2026-11-05T12:59:46.310676Z DEBUG dsc_lib::dscresources::command_resource: 912: Process 'powershell' id 7132 exited with code 0
2026-11-05T12:59:46.333279Z DEBUG dsc_lib::discovery::command_discovery: 347: Extension 'Microsoft.Windows.Appx/Discover' found 4 resources
2026-11-05T12:59:46.334744Z DEBUG dsc_lib::discovery::command_discovery: 381: Using type name filter 'Microsoft.Adapter/PowerShell' as filter for adapter name
2026-11-05T12:59:46.335090Z DEBUG dsc_lib::discovery::command_discovery: 383: Using type name filter '*' as filter for resource name
2026-11-05T12:59:46.969430Z DEBUG dsc_lib::dscresources::command_resource: 1329: PID 4960: Cache file not found 'C:\Users\Administrator\AppData\Local\dsc\PSAdapterCache.json'
2026-11-05T12:59:46.973070Z DEBUG dsc_lib::dscresources::command_resource: 1329: PID 4960: Constructing Get-DscResource cache
2026-11-05T12:59:47.429156Z ERROR dsc_lib::dscresources::command_resource: 1323: PID 4960: Script failed with terminating error at line 385 for statement `                    [System.Collections.Generic.List[DscResourceInfo]]$r = LoadPowerShellClassResourcesFromModule -moduleInfo $selectedMod
` - System.Management.Automation.RuntimeException: You cannot call a method on a null-valued expression.
   at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
   at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)
   at System.Management.Automation.PSScriptCmdlet.RunClause(Action`1 clause, Object dollarUnderbar, Object inputToProcess)
   at System.Management.Automation.CommandProcessorBase.Complete()
2026-11-05T12:59:47.481134Z DEBUG dsc_lib::dscresources::command_resource: 912: Process 'pwsh' id 4960 exited with code 1
2026-11-05T12:59:47.481933Z ERROR dsc_lib::dscresources::command_resource: 970: Failed to run process 'pwsh': Command: Resource 'pwsh' [exit code 1]
2026-11-05T12:59:47.483276Z  WARN dsc_lib::discovery::command_discovery: 414: Command: Resource 'pwsh' [exit code 1]
2026-11-05T12:59:47.485186Z DEBUG dsc_lib::discovery::command_discovery: 1091: Read 0 items into lookup table from "C:\\Users\\Administrator\\AppData\\Local\\dsc\\AdaptedResourcesLookupTable.json"

Type  Kind  Version  Capabilities  RequireAdapter  Description
--------------------------------------------------------------
Error details
2026-11-05T12:59:47.429156Z ERROR dsc_lib::dscresources::command_resource: 1323: PID 4960: Script failed with terminating error at line 385 for statement `                    [System.Collections.Generic.List[DscResourceInfo]]$r = LoadPowerShellClassResourcesFromModule -moduleInfo $selectedMod
` - System.Management.Automation.RuntimeException: You cannot call a method on a null-valued expression.
   at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
   at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)
   at System.Management.Automation.PSScriptCmdlet.RunClause(Action`1 clause, Object dollarUnderbar, Object inputToProcess)
   at System.Management.Automation.CommandProcessorBase.Complete()
Environment data
Name                           Value
----                           -----
PSVersion                      7.6.9
PSEdition                      Core
GitCommitId                    7.6.9
OS                             Microsoft Windows 10.0.26100
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.4
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
Version

dsc 3.4.0-preview.2 (also occurs on 3.3.0)

Visuals

No response

Lenguaje dominante
Rust
Estrellas
544
Forks
79
Merge medio
2 d 27 min
PR fusionados (30 d)
25

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de PowerShell/DSC

Todos los issues de PowerShell/DSC

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.