Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Belim authored Apr 19, 2024
1 parent 0b73288 commit 9a3f8d6
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions extensions/plug.restoreInboxApps.ps1.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Get all installed Windows apps for all users
$allApps = Get-AppxPackage -AllUsers

# Counter for tracking progress
$totalApps = $allApps.Count
$currentAppIndex = 1
$reinstalledCount = 0

# Loop through each app and reinstall
foreach ($app in $allApps) {
# Display current status
Write-Host "[$currentAppIndex / $totalApps] Reinstalling $($app.Name)..." -ForegroundColor Yellow

# Try to reinstall the app
try {
Add-AppxPackage -Register "$($app.InstallLocation)\appxmanifest.xml" -DisableDevelopmentMode -ErrorAction Stop
Write-Host "[$currentAppIndex / $totalApps] $($app.Name) reinstalled successfully." -ForegroundColor Green
$reinstalledCount++
} catch {
Write-Host "[$currentAppIndex / $totalApps] Error occurred while reinstalling $($app.Name): $_" -ForegroundColor Red
}

# Increment the counter
$currentAppIndex++
}

# Display final status
if ($reinstalledCount -eq $totalApps) {
Write-Host "All apps reinstalled successfully." -ForegroundColor Green
Write-Host "Winpilot and Clippy have reinstalled everything possible." -ForegroundColor Cyan
}

0 comments on commit 9a3f8d6

Please sign in to comment.