Skip to content

win_psDscAdapter and psDscAdapter PScredentials fix for passing username and password#1308

Open
mimachniak wants to merge 56 commits intoPowerShell:mainfrom
mimachniak:win_psDscAdapter-PSCredentials-fix-ScriptDSC
Open

win_psDscAdapter and psDscAdapter PScredentials fix for passing username and password#1308
mimachniak wants to merge 56 commits intoPowerShell:mainfrom
mimachniak:win_psDscAdapter-PSCredentials-fix-ScriptDSC

Conversation

@mimachniak
Copy link

PR Summary

  • I change creating object System.Management.Automation.PSCredential for ScriptBase resources base on Get-Credential parameters
  • Added dsc.yaml test file for ScriptBased DSC

PR Context

Fix using ScriptBased DSC resources when is reguired to use parameters with Get-Credentials

@mimachniak
Copy link
Author

@microsoft-github-policy-service agree

@mimachniak please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@microsoft-github-policy-service agree

@Gijsreyn
Copy link
Collaborator

@mimachniak - as I have already spoken with you on socials, is this perhaps also possible for class-based DSC resources (both in the 5.1 and 7.0 adapter)? Can you also include a testcase that covers this change?

@mimachniak
Copy link
Author

Yes I working o it

mimachniak and others added 3 commits December 17, 2025 16:26
…rt to System.Management.Automation.PSCredentia - code optimalization remove unused function
@mimachniak mimachniak changed the title Win ps dsc adapter ps credentials fix script dsc win_psDscAdapter and psDscAdapter PScredentials fix for passing username and password Dec 18, 2025
…t to System.Management.Automation.PSCredential
…t to System.Management.Automation.PSCredential - if change to recognize user information
@mimachniak
Copy link
Author

@Gijsreyn , @SteveL-MSFT - I added in test folder yaml's that are using TestClass for validation using PSCredentials, I tested on version 5.1 and 7 of PowerShell

@Gijsreyn
Copy link
Collaborator

@mimachniak - can it be tested inside the powershellgroup.config.tests.ps1 and win_powershellgroup.tests.ps1 or is it already covered?

@mimachniak
Copy link
Author

@mimachniak - can it be tested inside the powershellgroup.config.tests.ps1 and win_powershellgroup.tests.ps1 or is it already covered?

I will add today, I added yaml files for running test

@mimachniak
Copy link
Author

mimachniak commented Dec 21, 2025

@mimachniak - can it be tested inside the powershellgroup.config.tests.ps1 and win_powershellgroup.tests.ps1 or is it already covered?

I added unit test and validation in file in powershellgroup.config.tests.ps1

@mimachniak
Copy link
Author

I added test for 5.1 as well

@SteveL-MSFT
Copy link
Member

@mimachniak Thanks for adding the test resource, but there isn't a Pester test using it yet?

@mimachniak
Copy link
Author

mimachniak commented Jan 12, 2026

@SteveL-MSFT I will add test today

@mimachniak
Copy link
Author

@SteveL-MSFT can you approve marge ?

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 18 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

mimachniak and others added 18 commits February 25, 2026 22:19
….yaml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ntialValidation/CredentialValidation.psm1

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ntialValidation/CredentialValidation.psm1

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@mimachniak
Copy link
Author

@copilot open a new pull request to apply changes based on the comments in this thread

@mimachniak mimachniak closed this Feb 27, 2026
@mimachniak mimachniak reopened this Feb 27, 2026
@mimachniak
Copy link
Author

@SteveL-MSFT - all copilot suggestion resolved but this warring don't appear in .12 version so test cannot add this Validating deprecation warning for adapter 'Microsoft.Adapter/WindowsPowerShell'

@mimachniak
Copy link
Author

@SteveL-MSFT I update branch because linux build faild I see you add some fix, please allow to run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants