Advertisement
Cogger

Restore-WindowsStore.ps1

Aug 9th, 2023
1,743
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $tDir = "C:\temp\"
  2.    
  3. $urlArray= @(
  4.     "https://github.com/QuestYouCraft/Microsoft-Store-UnInstaller/blob/master/Packages/Microsoft.NET.Native.Framework.2.2_2.2.29512.0_x64__8wekyb3d8bbwe.Appx"
  5.     "https://github.com/QuestYouCraft/Microsoft-Store-UnInstaller/blob/master/Packages/Microsoft.NET.Native.Runtime.2.2_2.2.28604.0_x64__8wekyb3d8bbwe.Appx"
  6.     "https://github.com/QuestYouCraft/Microsoft-Store-UnInstaller/blob/master/Packages/Microsoft.UI.Xaml.2.4_2.42007.9001.0_x64__8wekyb3d8bbwe.appx"
  7.     "https://github.com/QuestYouCraft/Microsoft-Store-UnInstaller/blob/master/Packages/Microsoft.VCLibs.140.00_14.0.30035.0_x64__8wekyb3d8bbwe.Appx"
  8.     "https://github.com/QuestYouCraft/Microsoft-Store-UnInstaller/blob/master/Packages/Microsoft.WindowsStore_12107.1001.15.0_neutral___8wekyb3d8bbwe.AppxBundle")
  9.  
  10.     for ($i=0; $i -le $urlArray.Count -1 ; $i++) {
  11.  
  12.     $url  = $urlArray[$i]
  13.     $file = $url.Split('/')[-1]
  14.     $dest = $tDir + $file
  15.  
  16.  
  17.     Try {
  18.             Start-BitsTransfer -Source $url -Destination $dest
  19.         } Catch {
  20.             Write-Host("Unable to download $file from url.")
  21.         }
  22.  
  23.        <# #>
  24. }
  25.  
  26.  
  27. $EachFullName = (Get-ChildItem -Path $tDir -File -Recurse | Where-Object { ($_.Extension -eq ".Appx" ) -or ($_.Extension -eq ".msixbundle") -or ($_.Extension -eq ".AppxBundle") }).FullName
  28. $EachFullName | ForEach-Object { Add-AppxPackage -Path $_ ; Start-Sleep -Milliseconds 400 ; Remove-Item -Path $_ }
  29.  
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement