Skip to content

Cannot pass empty string as property value for WindowsPowerShell adapted resource #1542

@kevincathcart-cas

Description

@kevincathcart-cas

Prerequisites

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

Summary

Cannot seem to pass empty string as a property value for a WindowsPowerShell Adapted resource

Steps to reproduce

On clear core install of Server 2025:

  1. Install-WindowsFeature Web-Server
  2. Install-Module WebAdministrationDsc (answer yes as needed)
  3. Create the following configuraton yaml
resources:
  - name: Create App Pool
    type: WebAdministrationDsc/WebAppPool
    properties:
      Name: MyAppPool
      Ensure: Present
      ManagedRuntimeVersion: ''
  1. run dsc config set --file test.yaml

Expected behavior

Creates or modifies the app pool MyAppPool to have be configured for no managed code.

Actual behavior

Error (see below). I've tried a few different approaches for escaping, but I either end up getting told that my value 'does not belong to the set "v4.0,v2.0," specified by the ValidateSet attribute.' Or I get the main error.

Error details

PS C:\Users\Administrator\dsc> ./dsc config set --file .\test.yaml
2026-05-22T19:43:57.782580Z ERROR Error: Parser: Unable to parse statement root:
PS C:\Users\Administrator\dsc>

Environment data

Name                           Value
----                           -----
PSVersion                      5.1.26100.7462
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.26100.7462
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Version

3.2.1

Visuals

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions