fix: replace $windir with $env:SystemRoot in Themes module#1667
Merged
Conversation
Remove unused variable '$windir' from Themes.psm1
There was a problem hiding this comment.
Pull request overview
This PR intends to remove an allegedly unused $windir variable from the Themes PowerShell module.
Changes:
- Removed the
$windir = [Environment]::GetFolderPath('Windows')assignment fromThemes.psm1.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
|
@ me when this is complete please |
Contributor
Author
@RadNotRed Technically it is complete now. The variable is now implemented correctly. I saw I introduced a small bug in my previous commit. That is why it was on draft in the beginning😄 |
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.
Fixes PSScriptAnalyzer warning
PSUseDeclaredVarsMoreThanAssignmentsinThemes.psm1. https://github.com/Atlas-OS/Atlas/actions/runs/26191839863/job/77061913812$windir
was assigned inThemes.psm1but only used via outer-scope inDomain/ThemeRegistry.ps1`.PSScriptAnalyzer flags it as unused since it has no direct usage in the file.
$windirinThemeRegistry.ps1with$env:SystemRoot(built-in env var)This resolves the linter error without breaking functionality. See: https://github.com/Stensel8/Atlas-patches/actions/runs/26193046913/job/77065954691
The results/outputs will be the same, but this is a more modern approach to handle this env var. Using $windir was a thing of the CMD/BAT conventions. The more modern approach is to use $env:
Questions