diff --git a/CleaningScripts/AddWithOffice.ps1 b/CleaningScripts/AddWithOffice.ps1 new file mode 100644 index 0000000..7dfb9a4 --- /dev/null +++ b/CleaningScripts/AddWithOffice.ps1 @@ -0,0 +1,58 @@ + +$applist = @( +"*BingWeather*" +"*ZuneMusic*" +"*ZuneVideo*" +"*4DF9E0F8.Netflix" +"*9E2F88E3.Twitter" +"*CandyCrush*" +"*E046963F.LenovoCompanion" +"*Lenovo*" +"Microsoft.3DBuilder" +"Microsoft.Advertising*" +"Microsoft.Appconnector" +"Microsoft.Bing*" +"Microsoft.CommsPhone" +"Microsoft.ConnectivityStore" +"Microsoft.DesktopAppInstaller" +"Microsoft.Getstarted" +"Microsoft.Messaging" +"Microsoft.MicrosoftSolitaireCollection" +"Microsoft.MixedReality*" +"Microsoft.People" +"Microsoft.Services.Store.Engagement" +"Microsoft.SkypeApp" +"Microsoft.WindowsAlarms" +"Microsoft.windowscommunicationsapps" +"Microsoft.WindowsFeedbackHub" +"Microsoft.WindowsMaps" +"Microsoft.WindowsPhone" +"Microsoft.Xbox*" +"Microsoft.ZuneMusic" +"Microsoft.ZuneVideo" +"Microsoft.YourPhone*" +"TuneIn.TuneInRadio" +"Microsoft.MicrosoftOfficeHub" +"Microsoft.Office.OneNote" +"Microsoft.Office.Sway" +"Microsoft.OneConnect" +"Microsoft.WindowsStore" +"Microsoft.StorePurchaseApp" +) + +ForEach($app in $applist){ + Add-AppxPackage -AllUsers -Name $app -ErrorAction SilentlyContinue + Add-AppxPackage -Name $app -ErrorAction SilentlyContinue + Add-AppxProvisionedPackage -Online | where {$_.PackageName -like $app} | Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue + +} + + +https://akosbakos.ch/reinstall-windows-store-app/ +https://community.spiceworks.com/topic/2176027-how-to-add-windows-10-apps-back-with-powershell +Add-AppxProvisionedPackage -Online -PackagePath "E:\x86fre\Microsoft.Windows.Photos_8wekyb3d8bbwe.appxbundle" –LicensePath "E:\x86fre\Microsoft.Windows.Photos_8wekyb3d8bbwe.xml" + +https://www.winhelponline.com/blog/restore-windows-store-windows-10-uninstall-with-powershell/ + +https://www.guidingtech.com/fix-microsoft-store-missing-windows-10/ +PowerShell -ExecutionPolicy Unrestricted -Command "& {$manifest = (Get-AppxPackage *WindowsStore*).InstallLocation + '\AppxManifest.xml' ; Add-AppxPackage -DisableDevelopmentMode -Register $manifest}" diff --git a/CleaningScripts/CleanApps.bat b/CleaningScripts/CleanApps.bat new file mode 100644 index 0000000..4bb00ea --- /dev/null +++ b/CleaningScripts/CleanApps.bat @@ -0,0 +1,5 @@ +@echo off +set EXE="%SYSTEMROOT%\system32\WindowsPowerShell\v1.0\powershell.exe" +set TEMPLATE="C:\Scripts\CleaningScripts\CleanWithoutOffice.ps1" + +%EXE% -ExecutionPolicy Bypass -File %TEMPLATE% diff --git a/CleaningScripts/CleanWithOffice.ps1 b/CleaningScripts/CleanWithOffice.ps1 new file mode 100644 index 0000000..b1df6fd --- /dev/null +++ b/CleaningScripts/CleanWithOffice.ps1 @@ -0,0 +1,54 @@ + +$applist = @( +"*BingWeather*" +"*CandyCrush*" +"*Disney*" +"*LenovoCompanion*" +"*Lenovo*" +"Microsoft.3DBuilder*" +"Microsoft.Advertising*" +"Microsoft.Appconnector*" +"Microsoft.Bing*" +"Microsoft.CommsPhone*" +"Microsoft.ConnectivityStore*" +"Microsoft.DesktopAppInstaller*" +"Microsoft.Getstarted*" +"Microsoft.Messaging*" +"Microsoft.MicrosoftSolitaireCollection*" +"Microsoft.MixedReality*" +"Microsoft.OneConnect*" +"Microsoft.People*" +"Microsoft.SkypeApp*" +"Microsoft.WindowsAlarms*" +"Microsoft.windowscommunicationsapps*" +"Microsoft.WindowsFeedbackHub*" +"Microsoft.WindowsMaps*" +"Microsoft.WindowsPhone*" +"Microsoft.Xbox*" +"Microsoft.ZuneMusic*" +"Microsoft.ZuneVideo*" +"Microsoft.YourPhone*" +"*Netflix*" +"SpotifyAB.SpotifyMusic*" +"TuneIn.TuneInRadio*" +"*Twitter*" +"*ZuneMusic*" +"*ZuneVideo*" + +"Microsoft.Office.OneNote*" +"Microsoft.MicrosoftOfficeHub*" +"Microsoft.Office.Sway*" + +) + +#"Microsoft.Services.Store.Engagement" +#"Microsoft.WindowsStore" +#"Microsoft.StorePurchaseApp" + +ForEach($app in $applist){ + Get-AppxPackage -AllUsers -Name $app | Remove-AppxPackage -AllUsers -ErrorAction SilentlyContinue + Get-AppxPackage -Name $app | Remove-AppxPackage -ErrorAction SilentlyContinue + Get-AppxPackage -AllUsers -PackageTypeFilter Bundle -Name $app | Remove-AppxPackage -AllUsers -ErrorAction SilentlyContinue + Get-AppxProvisionedPackage -Online | where {$_.PackageName -like $app} | Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue + +} diff --git a/CleaningScripts/CleanWithoutOffice.ps1 b/CleaningScripts/CleanWithoutOffice.ps1 new file mode 100644 index 0000000..0f4f504 --- /dev/null +++ b/CleaningScripts/CleanWithoutOffice.ps1 @@ -0,0 +1,48 @@ + +$applist = @( +"*BingWeather*" +"*CandyCrush*" +"*Disney*" +"*LenovoCompanion*" +"*Lenovo*" +"Microsoft.3DBuilder*" +"Microsoft.Advertising*" +"Microsoft.Appconnector*" +"Microsoft.Bing*" +"Microsoft.CommsPhone*" +"Microsoft.ConnectivityStore*" +"Microsoft.DesktopAppInstaller*" +"Microsoft.Getstarted*" +"Microsoft.Messaging*" +"Microsoft.MicrosoftSolitaireCollection*" +"Microsoft.MixedReality*" +"Microsoft.OneConnect*" +"Microsoft.People*" +"Microsoft.SkypeApp*" +"Microsoft.WindowsAlarms*" +"Microsoft.windowscommunicationsapps*" +"Microsoft.WindowsFeedbackHub*" +"Microsoft.WindowsMaps*" +"Microsoft.WindowsPhone*" +"Microsoft.Xbox*" +"Microsoft.ZuneMusic*" +"Microsoft.ZuneVideo*" +"Microsoft.YourPhone*" +"*Netflix*" +"SpotifyAB.SpotifyMusic*" +"TuneIn.TuneInRadio*" +"*Twitter*" +"*ZuneMusic*" +"*ZuneVideo*" +) + +#"Microsoft.Services.Store.Engagement" +#"Microsoft.WindowsStore" +#"Microsoft.StorePurchaseApp" + +ForEach($app in $applist){ + Get-AppxPackage -AllUsers -Name $app | Remove-AppxPackage -AllUsers -ErrorAction SilentlyContinue + Get-AppxPackage -Name $app | Remove-AppxPackage -ErrorAction SilentlyContinue + Get-AppxProvisionedPackage -Online | where {$_.PackageName -like $app} | Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue + +} diff --git a/CleaningScripts/DisableCortana.ps1 b/CleaningScripts/DisableCortana.ps1 new file mode 100644 index 0000000..9faabe4 --- /dev/null +++ b/CleaningScripts/DisableCortana.ps1 @@ -0,0 +1,18 @@ +Write-Host "Disabling Cortana" + $Cortana1 = "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" + $Cortana2 = "HKCU:\SOFTWARE\Microsoft\InputPersonalization" + $Cortana3 = "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" + If (!(Test-Path $Cortana1)) { + New-Item $Cortana1 + } + Set-ItemProperty $Cortana1 AcceptedPrivacyPolicy -Value 0 + If (!(Test-Path $Cortana2)) { + New-Item $Cortana2 + } + Set-ItemProperty $Cortana2 RestrictImplicitTextCollection -Value 1 + Set-ItemProperty $Cortana2 RestrictImplicitInkCollection -Value 1 + If (!(Test-Path $Cortana3)) { + New-Item $Cortana3 + } + Set-ItemProperty $Cortana3 HarvestContacts -Value 0 + diff --git a/CleaningScripts/DumpApps.ps1 b/CleaningScripts/DumpApps.ps1 new file mode 100644 index 0000000..fdc6880 --- /dev/null +++ b/CleaningScripts/DumpApps.ps1 @@ -0,0 +1 @@ +Get-AppxPackage -AllUsers | Format-List -Property PackageFullName,PackageUserInformation | Out-File -FilePath c:\dumpapps.txt \ No newline at end of file diff --git a/CleaningScripts/EnableCortana.ps1 b/CleaningScripts/EnableCortana.ps1 new file mode 100644 index 0000000..3818538 --- /dev/null +++ b/CleaningScripts/EnableCortana.ps1 @@ -0,0 +1,18 @@ +Write-Host "Re-enabling Cortana" + $Cortana1 = "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" + $Cortana2 = "HKCU:\SOFTWARE\Microsoft\InputPersonalization" + $Cortana3 = "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" + If (!(Test-Path $Cortana1)) { + New-Item $Cortana1 + } + Set-ItemProperty $Cortana1 AcceptedPrivacyPolicy -Value 1 + If (!(Test-Path $Cortana2)) { + New-Item $Cortana2 + } + Set-ItemProperty $Cortana2 RestrictImplicitTextCollection -Value 0 + Set-ItemProperty $Cortana2 RestrictImplicitInkCollection -Value 0 + If (!(Test-Path $Cortana3)) { + New-Item $Cortana3 + } + Set-ItemProperty $Cortana3 HarvestContacts -Value 1 + diff --git a/CleaningScripts/Re-register_Store.bat b/CleaningScripts/Re-register_Store.bat new file mode 100644 index 0000000..31a7a51 --- /dev/null +++ b/CleaningScripts/Re-register_Store.bat @@ -0,0 +1,2 @@ +PowerShell -ExecutionPolicy Unrestricted -Command "& {$manifest = (Get-AppxPackage Microsoft.WindowsStore).InstallLocation + '\AppxManifest.xml' ; Add-AppxPackage -DisableDevelopmentMode -Register $manifest}" + diff --git a/CleaningScripts/b_DelApps.bat b/CleaningScripts/b_DelApps.bat new file mode 100644 index 0000000..4bb00ea --- /dev/null +++ b/CleaningScripts/b_DelApps.bat @@ -0,0 +1,5 @@ +@echo off +set EXE="%SYSTEMROOT%\system32\WindowsPowerShell\v1.0\powershell.exe" +set TEMPLATE="C:\Scripts\CleaningScripts\CleanWithoutOffice.ps1" + +%EXE% -ExecutionPolicy Bypass -File %TEMPLATE% diff --git a/CleaningScripts/reinstall-preinstalledApps.ps1 b/CleaningScripts/reinstall-preinstalledApps.ps1 new file mode 100644 index 0000000..2a6e29f --- /dev/null +++ b/CleaningScripts/reinstall-preinstalledApps.ps1 @@ -0,0 +1,37 @@ + +# Get all the provisioned packages +$Packages = (get-item 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Applications') | Get-ChildItem + +# Filter the list if provided a filter +$PackageFilter = $args[0] +if ([string]::IsNullOrEmpty($PackageFilter)) +{ + echo "No filter specified, attempting to re-register all provisioned apps." +} +else +{ + $Packages = $Packages | where {$_.Name -like $PackageFilter} + + if ($Packages -eq $null) + { + echo "No provisioned apps match the specified filter." + exit + } + else + { + echo "Registering the provisioned apps that match $PackageFilter" + } +} + +ForEach($Package in $Packages) +{ + # get package name & path + $PackageName = $Package | Get-ItemProperty | Select-Object -ExpandProperty PSChildName + $PackagePath = [System.Environment]::ExpandEnvironmentVariables(($Package | Get-ItemProperty | Select-Object -ExpandProperty Path)) + + # register the package + echo "Attempting to register package: $PackageName" + + Add-AppxPackage -register $PackagePath -DisableDevelopmentMode +} +