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
}
else
{
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_1.2.0.137_x86__8wekyb3d8bbwe -online
remove-AppxProvisionedPackage -package Microsoft.BingFinance_1.2.0.135_x86__8wekyb3d8bbwe -online
remove-AppxProvisionedPackage -package Microsoft.BingMaps_1.2.0.136_x86__8wekyb3d8bbwe -online
But I’d prefer to read the packagenames properly in a script - can I do this ?
Thanks
PS - can anyone recommend book or video to learn PS scripting ?