Skip to content

Update GA_offlinefixer.ps1 to v1.3#128

Open
anmocanu wants to merge 1 commit into
Azure:mainfrom
anmocanu:patch-11
Open

Update GA_offlinefixer.ps1 to v1.3#128
anmocanu wants to merge 1 commit into
Azure:mainfrom
anmocanu:patch-11

Conversation

@anmocanu

Copy link
Copy Markdown
Contributor

This script repairs a broken Azure Guest Agent by restoring registry keys and binaries from a rescue VM. It includes detailed steps for loading the SYSTEM hive, backing up, injecting service keys, and verifying the restoration process. .VERSION
v1.3: [May 2026] - Updated the script (current)
- Aligned nested VM detection with win-LKGC guard pattern.
- Skips Get-VM safely when Hyper-V module is unavailable.
v1.2: [May 2026] - Updated the script again (current)
- Fixed breaking exception when the Hyper-V module is not installed on the host.
- Added explicit checking via Get-Module before executing nested VM discovery.
v1.1: [May 2026] - Updated the script
- Included advanced Gen2 unlettered EFI fallback and dynamic drive-letter assignment.
v1.0: Initial commit. This was the version 1.0 of the script.

This script repairs a broken Azure Guest Agent by restoring registry keys and binaries from a rescue VM. It includes detailed steps for loading the SYSTEM hive, backing up, injecting service keys, and verifying the restoration process.
.VERSION
    v1.3: [May 2026] - Updated the script (current)
                       - Aligned nested VM detection with win-LKGC guard pattern.
                       - Skips Get-VM safely when Hyper-V module is unavailable.
    v1.2: [May 2026] - Updated the script again (current)
                       - Fixed breaking exception when the Hyper-V module is not installed on the host.
                       - Added explicit checking via Get-Module before executing nested VM discovery.
    v1.1: [May 2026] - Updated the script
                       - Included advanced Gen2 unlettered EFI fallback and dynamic drive-letter assignment.
    v1.0: Initial commit. This was the version 1.0 of the script.
@EdwinBernal1 EdwinBernal1 self-requested a review June 16, 2026 13:58
@EdwinBernal1

EdwinBernal1 commented Jun 16, 2026

Copy link
Copy Markdown
Member

Issues Found

🟡 Service disruption risk on rescue VM

Script force-stops WSearch and WinDefend and does not restore service state at end. On long-lived rescue hosts this can leave host security/indexing degraded after script completion.

Recommendation: capture original service states and restore them in finally.

🟡 Success can be reported even when fallback copy-back fails

When hive copy fallback ($hiveCopy) is used, copy-back to original hive happens in finally. If copy-back fails, error is logged, but disk can still remain in $fixedDisks, and overall script may still return success.

Recommendation: mark per-disk status failed if copy-back fails and exclude from success list.

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.

2 participants