- Notifications
You must be signed in to change notification settings - Fork45
Add credential support on PowerShell adapters#758
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This implementation seems to use the following snippet to determine whether to convert the input to a credential:
$_.Name-like'*Credential*'-and$_.Value.Username-and$_.Value.Password
However, I think we should probably consider checking thetarget property for whether it's expecting a credential or a secure string andthen trigger handling.
If so, should we still check if the username/password is provided in such a way? |
Just rewrote the part, but I'm struggling a little with the following error message from the pipeline: Exception calling "Invoke" with "4" argument(s): "The 'ConvertTo-SecureString' command was found in the module The test I wrote earlier for Windows PowerShell seems to fail on this part. I have commented it out for now. I have seen this issue before with other modules that run under the agent and wasn't able to find a workaround for it. Any suggestions are welcome. |
@SteveL-MSFT or@michaeltlombardi Do you perhaps have time to take another stab at this PR? The logic has changed to validate against the target property that is passed in. |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
8da5b0b
to1c69a6f
CompareGijsreyn commentedApr 26, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Finally, sorry for the extensive commit chain@SteveL-MSFT , but it should be good to go now! |
2b2a4f9
Uh oh!
There was an error while loading.Please reload this page.
PR Summary
This PR addresses#328. It adds a like check for credentials and searches the username and password fields as input.
PR Context
PowerShell adapters currently don't support creating PSCredential objects. Most DSC community-based DSC resources have the $Credential as input. Some others may vary; that's why the
-Like
operator is used.