Skip to content

Test-xDscSchema and Test-xDscResource report errors for any CIM class defined in the *.schema.mof that is not derived from OMI_ResourceBase. #44

@nanalakshmanan

Description

@nanalakshmanan

XCopy the CimETWProvider module and DSC resource
robocopy /s %sdxroot%\ admin\axp.test\cim\cimetwprovider\cmdletization "%ProgramFiles%"\WindowsPowerShell\Modules\CimETWProvider

Open a PowerShell prompt.
cd $env:programfiles\WindowsPowerShell\Modules\CimETWProvider\DscResources\MSFT_xEtwSession
Import-Module xDscResourceDesigner

Run Test-xDscSchema .\msft_xetwsession.schema.mof
Expected: No Errors
Actual: An erroneous error is reported for the Providers property
Test-SchemaProperty : In property Providers, only MSFT_Credential and MSFT_KeyValuePair are allowed as EmbeddedInstances.
At C:\Program Files\WindowsPowerShell\Modules\xDSCResourceDesigner\xDSCResourceDesigner.psm1:2335 char:17

  • ... $null = Test-SchemaProperty $_ ([ref]$hasKey) ([ref]$errorIds)
  •                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    • FullyQualifiedErrorId : InvalidEmbeddedInstance,Test-SchemaProperty
      Run Test-xDscResource xEtwsession
      Expected: No Errors
      Actual: Multiple erroneous errors are reported for the Providers property

Test-SchemaProperty : In property Providers, only MSFT_Credential and MSFT_KeyValuePair are allowed as EmbeddedInstances.
At C:\Program Files\WindowsPowerShell\Modules\xDSCResourceDesigner\xDSCResourceDesigner.psm1:2335 char:17

  • ... $null = Test-SchemaProperty $_ ([ref]$hasKey) ([ref]$errorIds)
  •                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    • FullyQualifiedErrorId : InvalidEmbeddedInstance,Test-SchemaProperty
      Test-BasicDscFunction : In function Get-TargetResource, the type Microsoft.Management.Infrastructure.CimInstance[] of parameter Providers is not supported.
      At C:\Program Files\WindowsPowerShell\Modules\xDSCResourceDesigner\xDSCResourceDesigner.psm1:2694 char:13
  • $null = Test-BasicDscFunction $GetCommandInfo.Value "Get-TargetRe ...
    
  •         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    • FullyQualifiedErrorId : UnsupportedTypeError,Test-BasicDscFunction
      Test-BasicDscFunction : In function Set-TargetResource, the type Microsoft.Management.Infrastructure.CimInstance[] of parameter Providers is not supported.
      At C:\Program Files\WindowsPowerShell\Modules\xDSCResourceDesigner\xDSCResourceDesigner.psm1:2696 char:13
  • $null = Test-BasicDscFunction $SetCommandInfo.Value "Set-TargetRe ...
    
  •         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    • FullyQualifiedErrorId : UnsupportedTypeError,Test-BasicDscFunction
      Test-BasicDscFunction : In function Test-TargetResource, the type Microsoft.Management.Infrastructure.CimInstance[] of parameter Providers is not supported.
      At C:\Program Files\WindowsPowerShell\Modules\xDSCResourceDesigner\xDSCResourceDesigner.psm1:2698 char:13
  • $null = Test-BasicDscFunction $TestCommandInfo.Value "Test-Target ...
    
  •         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    • FullyQualifiedErrorId : UnsupportedTypeError,Test-BasicDscFunction

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThe issue is a bug.help wantedThe issue is up for grabs for anyone in the community.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions