Skip to content

Simplify taskbar alignment detection and remediation scripts Afficher plus de lignes - #24

Open
Xtraim wants to merge 2 commits into
JayRHa:mainfrom
Xtraim:main
Open

Simplify taskbar alignment detection and remediation scripts Afficher plus de lignes#24
Xtraim wants to merge 2 commits into
JayRHa:mainfrom
Xtraim:main

Conversation

@Xtraim

@Xtraim Xtraim commented Aug 7, 2026

Copy link
Copy Markdown

This PR simplifies both detection and remediation scripts.

Changes:

  • Removed the unused Test-RegistryValue function
  • Added clearer logging output for Intune reporting
  • Used numeric comparison for TaskbarAl
  • Improved error handling with try/catch
  • Used New-ItemProperty -Force in remediation to handle both creation and update of the registry value
  • Switched Windows 11 detection to build number validation

Functionality remains unchanged:

  • Detects whether the taskbar is left-aligned
  • Remediates by setting TaskbarAl to 0
    `

Xtraim added 2 commits August 7, 2026 13:26
Updated version to 1.1 and improved registry check logic for Windows 11 taskbar alignment.

Before you had a function to check if value exist, then read the value, then compare.
Check registry -> read registry -> compare

Now you read the value, and if not readable = fail, else compare.
read registry if exist -> compare


More simple and visible, less registry access.
Updated version to 1.1 and improved OS check for Windows 11.

New-itemproerty instead of set : Because if value exist (update, if value not existing (create), in all case TaskbarAl = 0.

Delete test path, because try and catch already manage errors.
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.

1 participant