Fix 6 bugs across 7 files: NetbiosOptions copy-paste, taskbar cleanup… - #1694
Closed
Mohammad-Faiz-Cloud-Engineer wants to merge 1 commit into
Closed
Fix 6 bugs across 7 files: NetbiosOptions copy-paste, taskbar cleanup…#1694Mohammad-Faiz-Cloud-Engineer wants to merge 1 commit into
Mohammad-Faiz-Cloud-Engineer wants to merge 1 commit into
Conversation
…, IndexOf guards, curl exit codes, vssadmin stderr
TECHNICAL EXPLANATION
---------------------
1. EnableFileSharing.ps1:14 - NetbiosOptions copy-paste bug (Medium)
- Bug: Value 2 means Disable NetBIOS; copied from DisableFileSharing.ps1
- Fix: Changed to Value 0 (Default/Enable)
- Impact: Enabling file sharing now actually enables NetBIOS
2. TASKBARPINS.ps1:99-102 - Dead code and error on missing path (Low)
- Bug: Test-Path -PathType Leaf checks if path is a FILE; TaskBar is a DIRECTORY
- Fix: Replaced with simple Test-Path + Remove-Item wildcard
- Impact: No more cosmetic red errors when TaskBar dir doesn't exist
3. SETPATHS.ps1:19-23 - IndexOf(-1) unguarded access (Medium)
- Bug: Substring(-1 + marker.Length) produces corrupted paths when marker not found
- Fix: Added if ( -ge 0) guard
- Impact: No more corrupted registry values for unmatched paths
4. LIBREWOLF.ps1:26,48 - Missing curl exit code check (Medium)
- Bug: ErrorActionPreference does not apply to native EXEs; curl failures silently ignored
- Fix: Added if (!True) { throw } after each curl download
- Impact: Failed downloads now correctly halt the script
5. ASSOC.ps1:204-208 - IndexOf(-1) unguarded access (Medium)
- Bug: IndexOf with startIndex=-1 crashes on non-English Windows where search string is absent
- Fix: Added if ( -ge 0) guard with nested bounds check
- Impact: No more crash when Shell32.dll lacks English text
6. CLEANUP.ps1:103 - vssadmin stderr noise (Low)
- Bug: vssadmin prints errors to stderr when no shadow copies exist
- Fix: Added 2> to suppress stderr
- Impact: Cleaner output for non-critical cleanup operation
7. packageInstall.ps1:306 - Misleading comment (Trivial)
- Bug: Comment said 'add test cert' but it adds the real Atlas cert
- Fix: Updated comment to 'add Atlas cert to root store'
- Impact: Documentation accuracy
PLAIN ENGLISH EXPLANATION
-------------------------
1. ENABLING FILE SHARING STILL BLOCKED FILE SHARING - The script that turns on file sharing accidentally copied a line from the 'turn off' script that still blocked sharing. Like unlocking a door but leaving the deadbolt on. Now enabling actually enables everything.
2. TASKBAR CLEANER WAS LOOKING IN THE WRONG PLACE - When pinning browser shortcuts, the cleanup code checked 'is this a file?' when the taskbar is actually a folder. That check never worked, so it always fell through to code that throws scary red errors if the taskbar folder doesn't exist. Now it just checks 'does this exist?' and cleans up safely.
3. PATH CORRECTION WAS CORRUPTING PATHS - A script fixes folder paths that point to wrong locations. But if the path didn't contain the text it was looking for, it would chop off the beginning and write garbage to the registry. Now it safely skips paths it can't fix.
4. DOWNLOADS COULD SILENTLY FAIL - When downloading LibreWolf, if the internet dropped mid-download, the script wouldn't notice and would try to install a broken file. Now it checks the download worked before continuing.
5. FILE ASSOCIATION SETUP COULD CRASH - Setting which browser opens which file type reads from a system file. On non-English Windows, that file might not have the English text it was searching for, causing the whole script to crash. Now it handles missing text gracefully.
6. ERROR MESSAGE FROM DISK CLEANUP - A cleanup command printed scary red errors when there was nothing to clean up. Now it runs silently.
7. A MISLEADING NOTE - A comment in the code said 'add test cert' but it was actually adding the real security certificate. Now the note says what it actually does.
Mohammad-Faiz-Cloud-Engineer
requested review from
RadNotRed and
Xyueta
as code owners
July 30, 2026 21:23
TheyCreeper
approved these changes
Aug 1, 2026
RadNotRed
requested changes
Aug 1, 2026
Author
so should i close this pr and open a new one? |
Member
👍 |
Author
|
i want one help, i am not getting the new-update branch when forking the repo only getting the main branch, how can i get the new-update branch? |
if u are using vscode, it shows up as a remote branch |
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.
…, IndexOf guards, curl exit codes, vssadmin stderr
TECHNICAL EXPLANATION
EnableFileSharing.ps1:14 - NetbiosOptions copy-paste bug (Medium)
TASKBARPINS.ps1:99-102 - Dead code and error on missing path (Low)
SETPATHS.ps1:19-23 - IndexOf(-1) unguarded access (Medium)
LIBREWOLF.ps1:26,48 - Missing curl exit code check (Medium)
ASSOC.ps1:204-208 - IndexOf(-1) unguarded access (Medium)
CLEANUP.ps1:103 - vssadmin stderr noise (Low)
packageInstall.ps1:306 - Misleading comment (Trivial)
PLAIN ENGLISH EXPLANATION
ENABLING FILE SHARING STILL BLOCKED FILE SHARING - The script that turns on file sharing accidentally copied a line from the 'turn off' script that still blocked sharing. Like unlocking a door but leaving the deadbolt on. Now enabling actually enables everything.
TASKBAR CLEANER WAS LOOKING IN THE WRONG PLACE - When pinning browser shortcuts, the cleanup code checked 'is this a file?' when the taskbar is actually a folder. That check never worked, so it always fell through to code that throws scary red errors if the taskbar folder doesn't exist. Now it just checks 'does this exist?' and cleans up safely.
PATH CORRECTION WAS CORRUPTING PATHS - A script fixes folder paths that point to wrong locations. But if the path didn't contain the text it was looking for, it would chop off the beginning and write garbage to the registry. Now it safely skips paths it can't fix.
DOWNLOADS COULD SILENTLY FAIL - When downloading LibreWolf, if the internet dropped mid-download, the script wouldn't notice and would try to install a broken file. Now it checks the download worked before continuing.
FILE ASSOCIATION SETUP COULD CRASH - Setting which browser opens which file type reads from a system file. On non-English Windows, that file might not have the English text it was searching for, causing the whole script to crash. Now it handles missing text gracefully.
ERROR MESSAGE FROM DISK CLEANUP - A cleanup command printed scary red errors when there was nothing to clean up. Now it runs silently.
A MISLEADING NOTE - A comment in the code said 'add test cert' but it was actually adding the real security certificate. Now the note says what it actually does.