Bob_the_Goon Posted September 27, 2017 Posted September 27, 2017 I'm having a bit of a nightmare here trying to remove the AppxProvisioned apps (XBox etc) from our Windows 10 builds. I've a PS script that when run manually, successfully removes all of the crap from the OS however when I add the same script to a MDT 2013 Task Sequence the script fails to run. Does anyone deploy Win10 using solely MDT 2013? If so, would you be willing to share what commands you are using in the task sequence as well as where in the task sequence you are placing the commands? I've tried all sorts to get this working however my current attempt is the following: Under "State Restore" >>> "Custom Tasks" I have two separate "Run Command Line" tasks. The first specifies the following command powershell.exe -command "Set-ExecutionPolicy Bypass" The second task is a "Run Command Line" task with the following command powershell.exe -file "%SCRIPTROOT%\Script.ps1" I'm trying to use this on a 1703 64 bit build. How are you guys achieving this?
win Posted September 27, 2017 Posted September 27, 2017 here you go, works with windows 10 edu 1703 x64, could do with extra tweaking but it works nonetheless at MDT 2013 stage $AppsList = "Microsoft.3DBuilder","Microsoft.BingWeather","Microsoft.Getstarted","Microsoft.Messaging","Microsoft.MicrosoftOfficeHub","Microsoft.MicrosoftSolitaireCollection","Microsoft.OneConnect","Microsoft.People","Microsoft.SkypeApp","microsoft.windowscommunicationsapps","Microsoft.WindowsFeedbackHub","Microsoft.WindowsMaps","Microsoft.XboxApp","Microsoft.XboxIdendityProvider","Microsoft.ZuneMusic","Microsoft.ZuneVideo","Microsoft.DesktopAppinstaller","Microsoft.StorePurchaseApp","Microsoft.Wallet","Microsoft.WindowsStore","Microsoft.XboxGameOverlay","Microsoft.XboxSpeechToTextOverlay","Microsoft.WindowsAlarms","Microsoft.MicrosoftEdge" ForEach ($App in $AppsList) { $PackageFullName = (Get-AppxPackage $App).PackageFullName $ProPackageFullName = (Get-AppxProvisionedPackage -online | where {$_.Displayname -eq $App}).PackageName If ($PackageFullName) { Write-Verbose "Removing Package: $App" remove-AppxPackage -package $PackageFullName } Else { Write-Host "Unable to find package: $App" } If ($ProPackageFullName) { Write-Verbose "Removing Provisioned Package: $ProPackageFullName" Remove-AppxProvisionedPackage -online -packagename $ProPackageFullName } Else { Write-Verbose "Unable to find provisioned package: $App" } } 1
LukeRowberry Posted September 27, 2017 Posted September 27, 2017 This is mine - works perfectly. Power shell file attached just put it in your scripts folder. LukeRemoveApps.ps1 2
gshaw Posted September 27, 2017 Posted September 27, 2017 ^^^ that's basically the same as mine too, works like a charm 1
Bob_the_Goon Posted September 27, 2017 Author Posted September 27, 2017 Thank you fellow Edugeeks. I used Luke's solution (just because it was the first I came too) and it now works! My original script mustn't have been compatible with this way of deployment (it worked when manually running it). Thanks again as I've spent hours trying to sort this!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now