-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Labels
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest version
- Search the existing issues.
Summary
In certain scenarios, I do not require a full credential object to be passed. Instead, I'm declaring a class-based DSC resource property as such:
[DscProperty()]
[SecureString] $TokenHowever, trying to execute this through the adapter fails with the error:
2025-10-24T08:37:49.229612Z ERROR dsc_lib::dscresources::command_resource: 961: PID 68772: Exception: Exception setting "Token": "Cannot convert the value of type "System.String" to type "System.Security.SecureString"."
Steps to reproduce
Create a class-based DSC resource with a [SecureString] property and try to execute it.
Expected behavior
The class gets instantiated with the property as `[SecureString]`.Actual behavior
Error is thrown.Error details
Environment data
Name Value
---- -----
PSVersion 7.5.3
PSEdition Core
GitCommitId 7.5.3
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.0Version
dsc 3.2.0-preview.6
Visuals
No response