October 10, 2013 at 12:27 am #10636
I'm trying to use a PS script (I'm new to scripting) to remove the Provisioned apps on the Windows 8 start screen
I got this script from the Microsoft forum
$AppsList = "Microsoft.Bing" , "Microsoft.BingFinance" , "Microsoft.BingMaps" , "Microsoft.BingNews",`
"Microsoft.BingSports" , "Microsoft.BingTravel" , "Microsoft.BingWeather" , "Microsoft.Camera",`
"microsoft.microsoftskydrive" , "Microsoft.Reader" , "microsoft.windowscommunicationsapps",`
"microsoft.windowsphotos" , "Microsoft.XboxLIVEGames" , "Microsoft.ZuneMusic", "Microsoft.ZuneVideo"
#ForEach ($App in $AppsList)
# $PackageFullName = (Get-AppxPackage $App).PackageFullName
# if ((Get-AppxPackage $App).PackageFullName)
# Write-Host "Removing Package: $App"
# remove-AppxProvisionedPackage -online -packagename $PackageFullName
# remove-AppxPackage -package $PackageFullName
# Write-Host "Unable to find package: $App"
This works fine if you are logged on to an account but I am calling the script from an SCCM deployment. Whilst running it no profiles have been set up so you can't seem to issue the get-appxpackage command
I'm trying to remove the Provisionedpackages in the image so I tried to use the same syntax to get the Packagename of the provisioned app e.g. $PackageFullName = (Get-AppxProvisionedPackage -online $App).PackageName and variants of this but could not get it to work.
If I manually put each one in longhand it works fine e.g.
remove-AppxProvisionedPackage -package Microsoft.Bing_184.108.40.206_x86__8wekyb3d8bbwe -online
remove-AppxProvisionedPackage -package Microsoft.BingFinance_220.127.116.11_x86__8wekyb3d8bbwe -online
remove-AppxProvisionedPackage -package Microsoft.BingMaps_18.104.22.168_x86__8wekyb3d8bbwe -online
But I'd prefer to read the packagenames properly in a script – can I do this ?
PS – can anyone recommend book or video to learn PS scripting ?
October 11, 2013 at 3:13 am #10681
October 12, 2013 at 2:24 am #10720
Many thanks for the book -have just ordered it. Yes can just put the name of each and every appxprovisionedpackage but I was hoping to use the short or displayname in the example and to be able to get the fullname out – if this can be done I'd be happy to hear
You must be logged in to reply to this topic.