DSC icon indicating copy to clipboard operation
DSC copied to clipboard

WMI adapter fails on `get` with read-only properties

Open Gijsreyn opened this issue 1 month ago • 0 comments

Prerequisites

  • [x] Write a descriptive title.
  • [x] Make sure you are able to repro it on the latest version
  • [x] 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

Gijsreyn avatar Nov 12 '25 02:11 Gijsreyn