Skip to content

Class-based DSC resource properties alignment #878

Open
@Gijsreyn

Description

@Gijsreyn

Prerequisites

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

Summary

When using the WinPS adapter, class-based properties don't align with what is happening in the PS adapter. This is because the WinPS adapter uses the Get-DscResource command from PSDesiredStateConfiguration, whereas the PS adapter leverages AST. See screenshot:

Image

Steps to reproduce

  1. Add the dsc.exe to the PATH variable
  2. Run dsc resource get --resource TestClassResource/TestClassResource --input (@{Name = 'test'} | ConvertTo-Json)
  3. Add the tests folder to PSModulePath
  4. Run dsc resource list --adapter Microsoft.Windows/WindowsPowerShell
  5. Run dsc resource get --resource TestClassResource/TestClassResource --input (@{Name = 'test'} | ConvertTo-Json) again

See the output:

Image

Expected behavior

The properties should be the same

Actual behavior

The properties aren't the same

Error details

Environment data

Name                           Value
----                           -----
PSVersion                      7.5.1
PSEdition                      Core
GitCommitId                    7.5.1
OS                             Microsoft Windows 10.0.22631
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Version

dsc 3.2.0-preview.1

Visuals

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions