Skip to content

WMI adapter fails on get with read-only properties #1253

@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

The WMI adapter throws a parameter binding error when performing a get operation with a read-only property as a filter.

Reported on Discord.

Steps to reproduce

Run the following example:

$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
resources:
- name: Get info from WMI
  type: Microsoft.Windows/WMI
  properties:
    resources:
    - name: Get OS Info
      type: root.cimv2/Win32_ComputerSystem     
      properties:
        manufacturer: Dell

Expected behavior

Get operation should succeed when filtering by read-only properties.

Actual behavior

Exception calling "Invoke" with "3" argument(s): "Cannot bind argument to parameter 'Properties' because it is null."

Error details

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

dsc 3.2.0-preview.8

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