Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
SteveL-MSFT merged 32 commits intoPowerShell:mainfromGijsreyn:add-credential-support
Apr 26, 2025

Conversation

Gijsreyn
Copy link
Contributor

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.

Copy link
Collaborator

@michaeltlombardimichaeltlombardi left a 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.

SteveL-MSFT reacted with thumbs up emoji
@Gijsreyn
Copy link
ContributorAuthor

If so, should we still check if the username/password is provided in such a way?

@GijsreynGijsreyn marked this pull request as draftApril 21, 2025 14:58
@GijsreynGijsreyn marked this pull request as ready for reviewApril 21, 2025 15:19
@Gijsreyn
Copy link
ContributorAuthor

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
2025-04-21T14:56:29.911181Z TRACE dsc_lib::dscresources::command_resource: 890: PID 6992: 'Microsoft.PowerShell.Security', but the module could not be loaded. For more information, run 'Import-Module
2025-04-21T14:56:29.911238Z TRACE dsc_lib::dscresources::command_resource: 890: PID 6992: Microsoft.PowerShell.Security'."

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.

@Gijsreyn
Copy link
ContributorAuthor

@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.

SteveL-MSFT reacted with thumbs up emoji

@GijsreynGijsreynforce-pushed theadd-credential-support branch from8da5b0b to1c69a6fCompareApril 25, 2025 10:52
@Gijsreyn
Copy link
ContributorAuthor

Gijsreyn commentedApr 26, 2025
edited
Loading

Finally, sorry for the extensive commit chain@SteveL-MSFT , but it should be good to go now!

@SteveL-MSFTSteveL-MSFT added this pull request to themerge queueApr 26, 2025
Merged via the queue intoPowerShell:main with commit2b2a4f9Apr 26, 2025
4 checks passed
@GijsreynGijsreyn deleted the add-credential-support branchJuly 12, 2025 23:05
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@SteveL-MSFTSteveL-MSFTSteveL-MSFT approved these changes

@michaeltlombardimichaeltlombardiAwaiting requested review from michaeltlombardi

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@Gijsreyn@SteveL-MSFT@michaeltlombardi

[8]ページ先頭

©2009-2025 Movatter.jp