this is probably scrub s**t for some of you guys, but these are a couple scripts i run on my boxes following Windows 10 install. Make sure you set-executionpolicy remotesigned if you try these as scripts. I cant post a link, so make sure you modify the $source below, should be fairly obvious what it should be set to. Code: If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { $arguments = "& '" + $myinvocation.mycommand.definition + "'" Start-Process powershell -Verb runAs -ArgumentList $arguments Break } # Run your code that needs to be elevated here $source = "h++p://winhelp2002 mvps org/hosts.txt" $destination = "c:\windows\system32\drivers\etc\hosts" Invoke-WebRequest $source -OutFile $destination Code: If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { $arguments = "& '" + $myinvocation.mycommand.definition + "'" Start-Process powershell -Verb runAs -ArgumentList $arguments Break } get-appxpackage -AllUsers -Name Microsoft.3DBuilder | remove-appxpackage get-appxpackage -AllUsers -Name Microsoft.Getstarted | remove-appxpackage get-appxpackage -AllUsers -Name Microsoft.MicrosoftOfficeHub | remove-appxpackage get-appxpackage -AllUsers -Name Microsoft.MicrosoftSolitaireCollection | remove-appxpackage get-appxpackage -AllUsers -Name Microsoft.SkypeApp | remove-appxpackage get-appxpackage -AllUsers -Name Microsoft.WindowsMaps | remove-appxpackage get-appxpackage -AllUsers -Name Microsoft.BingWeather | remove-appxpackage get-appxpackage -AllUsers -Name Microsoft.Office.OneNote | remove-appxpackage get-appxpackage -AllUsers -Name Microsoft.XboxApp | remove-appxpackage get-appxpackage -AllUsers -Name Microsoft.ZuneMusic | remove-appxpackage get-appxpackage -AllUsers -Name Microsoft.ZuneVideo | remove-appxpackage get-appxpackage -AllUsers -Name Microsoft.BingSports | remove-appxpackage get-appxpackage -AllUsers -Name Microsoft.BingNews | remove-appxpackage get-appxpackage -AllUsers -Name Microsoft.WindowsPhone | remove-appxpackage get-appxpackage -AllUsers -Name Microsoft.BingFinance | remove-appxpackage write-host "completed"
Honestly, I'm not sure. I had a similar script for windows 8.1 but i've never wanted to add anything back before. There is an Add-AppXPackage cmdlet but you have to specify a path.
One has to be wary of the consequences. It might be consuming much of your memory with time. It is not always advisable.