Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

DSC seems to inject "Verbose" key into resource properties, causing an error when "Verbose" is not a property in the DSC resource schema file

Abierto
#1,296 8 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@theJasonHelmick ya está trabajando en esto.

Desde el 22/1/2026.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

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

Attempting to test deploy a microsoft365DSC resource: "Microsoft365DSC/IntuneDeviceConfigurationPlatformScriptWindows"

Fails with an error stating:

Exception: The PowerShell DSC resource  returned results that are not valid from Get-TargetResource.
The Verbose key is not a valid property in the corresponding DSC resource schema file. The results
from Get-TargetResource must be in a Hashtable format. The keys in the Hashtable must be the same as
the properties in the corresponding DSC resource schema file.

I haven't added the key "Verbose", it seems to be a default behaviour of the adapter that I can't turn off.

Steps to reproduce
  1. Write config document, no Verbose key included:

    $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
    resources:
      - name: Intune Test
        type: Microsoft.Windows/WindowsPowerShell
        properties:
          resources:
            - name: Test-Intune-Script
              type: Microsoft365DSC/IntuneDeviceConfigurationPlatformScriptWindows
              properties:
                Id: "34cedb35-7569-4d20-acbc-81c12c2d9507"
                DisplayName: "TestCustomScript"
                Ensure: "Present"
                EnforceSignatureCheck: false
                FileName: "test-dsc.ps1"
                RunAs32Bit: false
                RunAsAccount: "system"
                ScriptContent: "test"
                ApplicationId: "###"
                TenantId: "###"
                CertificateThumbprint: "###"
    
  2. Attempt to deploy using:

    dsc -l trace config set --file .\test.yml
    
  3. Check M365DSC Event Log, sure enough the verbose key appears:

    <M365DSCEvent>
        <ConfigurationDrift Source="MSFT_IntuneDeviceConfigurationPlatformScriptWindows" TenantId="wgadev.onmicrosoft.com">
            <ParametersNotInDesiredState>
                <Param Name="Ensure"><CurrentValue>Absent</CurrentValue><DesiredValue>Present</DesiredValue></Param>
                <Param Name="Ensure"><CurrentValue>Absent</CurrentValue><DesiredValue>Present</DesiredValue></Param>
            </ParametersNotInDesiredState>
        </ConfigurationDrift>
        <DesiredValues>
            <Param Name ="DisplayName">TestCustomScript</Param>
            <Param Name ="EnforceSignatureCheck">False</Param>
            <Param Name ="FileName">test-dsc.ps1</Param>
            <Param Name ="RunAs32Bit">False</Param>
            <Param Name ="RunAsAccount">system</Param>
            <Param Name ="ScriptContent">test</Param>
            <Param Name ="Id">34cedb35-7569-4d20-acbc-81c12c2d9507</Param>
            <Param Name ="Ensure">Present</Param>
            <Param Name ="ApplicationId">###</Param>
            <Param Name ="TenantId">###</Param>
            <Param Name ="CertificateThumbprint">###</Param>
            <Param Name ="Verbose">True</Param>
        </DesiredValues>
        <CurrentValues>
            <Param Name ="EnforceSignatureCheck">False</Param>
            <Param Name ="ScriptContent">test</Param>
            <Param Name ="FileName">test-dsc.ps1</Param>
            <Param Name ="RunAsAccount">system</Param>
            <Param Name ="Id">34cedb35-7569-4d20-acbc-81c12c2d9507</Param>
            <Param Name ="Verbose">True</Param>
            <Param Name ="ApplicationId">###</Param>
            <Param Name ="DisplayName">TestCustomScript</Param>
            <Param Name ="Ensure">Absent</Param>
            <Param Name ="CertificateThumbprint">###</Param>
            <Param Name ="RunAs32Bit">False</Param>
            <Param Name ="TenantId">###</Param>
        </CurrentValues>
    </M365DSCEvent>
    
Expected behavior
dsc -l debug config set --file .\test.yml

results:
 - name: Intune Test
   type: Microsoft.Windows/WindowsPowerShell
   result: 
     actualState:
       output: not sure..
messages: []
hadErrors: false
Actual behavior
NativeErrorCode : TypeMismatch
ErrorData       : MSFT_WmiError
MessageId       : GetOperationResultInvalidResultFormat
ErrorSource     :
ErrorType       : 0
StatusCode      : 13
Message         : The PowerShell DSC resource  returned results that are not valid from 
                  Get-TargetResource. The Verbose key is not a valid property in the corresponding
                  DSC resource schema file. The results from Get-TargetResource must be in a Hashtable
                  format. The keys in the Hashtable must be the same as the properties in the
                  corresponding DSC resource schema file.
Data            : {}
InnerException  :
TargetSite      : Void ProcessNativeCallback(Microsoft.Management.Infrastructure.Native.OperationCallbackProcessingContext,
                  T, Boolean, Microsoft.Management.Infrastructure.Native.MiResult, System.String, Microsoft.Management.
                  Infrastructure.Native.InstanceHandle)
StackTrace      :    at Microsoft.Management.Infrastructure.Internal.Operations.CimAsyncObserverProxyBase`1.ProcessNativeCallback
                  (OperationCallbackProcessingContext callbackProcessingContext, T currentItem,
                  Boolean moreResults, MiResult operationResult, String errorMessage, InstanceHandle
                  errorDetailsHandle)
HelpLink        :
Source          : Microsoft.Management.Infrastructure
HResult         : -2146233088


2025-11-28T05:54:26.367258Z ERROR dsc_lib::dscresources::command_resource: 896: PID 31112: Exception:
    The PowerShell DSC resource  returned results that are not valid from Get-TargetResource. The
    Verbose key is not a valid property in the corresponding DSC resource schema file. The results
    from Get-TargetResource must be in a Hashtable format. The keys in the Hashtable must be the
    same as the properties in the corresponding DSC resource schema file.
2025-11-28T05:54:26.441405Z DEBUG dsc_lib::dscresources::command_resource: 660: Process 'powershell'
    id 31112 exited with code 1
2025-11-28T05:54:26.446813Z ERROR dsc::subcommand: 106: Error: Command: Resource 'powershell'
    [exit code 1] manifest description: Error
Error details
2025-11-28T05:45:31.683970Z ERROR dsc_lib::dscresources::command_resource: 896: PID 33424: Exception:
    The PowerShell DSC resource  returned results that are not valid from Get-TargetResource. The
    Verbose key is not a valid property in the corresponding DSC resource schema file. The results
    from Get-TargetResource must be in a Hashtable format. The keys in the Hashtable must be the
    same as the properties in the corresponding DSC resource schema file.
2025-11-28T05:45:31.763039Z DEBUG dsc_lib::dscresources::command_resource: 660: Process 'powershell'
    id 33424 exited with code 1
2025-11-28T05:45:31.769200Z ERROR dsc::subcommand: 106: Error: Command: Resource 'powershell'
    [exit code 1] manifest description: Error
Environment data
Name                           Value
----                           -----
PSVersion                      7.5.4
PSEdition                      Core
GitCommitId                    7.5.4
OS                             Microsoft Windows 10.0.26100
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
Version

3.2.0-preview.2

Visuals

No response

Lenguaje dominante
Rust
Estrellas
536
Forks
76
Merge medio
1 d 11 h
PR fusionados (30 d)
15

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.