Remove disabled LocalAccounts test files #27211
Open
TravisEz13 wants to merge 1 commit intoPowerShell:masterfrom
Open
Remove disabled LocalAccounts test files #27211TravisEz13 wants to merge 1 commit intoPowerShell:masterfrom
TravisEz13 wants to merge 1 commit intoPowerShell:masterfrom
Conversation
… violation The Microsoft.PowerShell.LocalAccounts module was removed in 2017 (issue PowerShell#4272) because it used unsupported native APIs. The three test files in this directory have been disabled with an early eturn ever since, making them permanently dead code. PSScriptAnalyzer (via S360/SFI scanning) flags PSAvoidUsingConvertToSecureStringWithPlainText violations in the dead code of LocalUser.Tests.ps1. The existing SuppressMessageAttribute in the param() block is not being honored by the S360 scanner. Deleting the directory is the correct fix: the module is gone, the tests can never run, and keeping them creates ongoing compliance burden. Resolves S360 ADO bug 34502946. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Removes long-disabled Pester tests for the legacy Microsoft.PowerShell.LocalAccounts module to eliminate S360/PSScriptAnalyzer findings coming from permanently-dead test code.
Changes:
- Deleted the
test/powershell/Modules/Microsoft.PowerShell.LocalAccounts/test files that were effectively unreachable due to an earlyreturn. - Eliminated
ConvertTo-SecureString -AsPlainTextusage that was being flagged by S360 despite in-file suppressions.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| test/powershell/Modules/Microsoft.PowerShell.LocalAccounts/Pester.Command.Cmdlets.LocalAccounts.LocalUser.Tests.ps1 | Removed disabled LocalUser cmdlet tests containing S360-flagged ConvertTo-SecureString -AsPlainText calls. |
| test/powershell/Modules/Microsoft.PowerShell.LocalAccounts/Pester.Command.Cmdlets.LocalAccounts.LocalGroup.Tests.ps1 | Removed disabled LocalGroup cmdlet tests. |
| test/powershell/Modules/Microsoft.PowerShell.LocalAccounts/Pester.Command.Cmdlets.LocalAccounts.LocalGroupMember.Tests.ps1 | Removed disabled LocalGroupMember cmdlet tests. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Delete dead code because it triggers compliance issues