Remove Win8 Provisionedpackages

This topic contains 2 replies, has 2 voices, and was last updated by  IanBurnell 3 years, 10 months ago.

  • Author
    Posts
  • #10636

    IanBurnell
    Participant

    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 ?

  • #10681

    Richard Siddaway
    Moderator

    If the full name works I'd stick with that

    A good book to start your PowerShell learning?
    http://www.manning.com/jones3/

    also available from amazon etc

  • #10720

    IanBurnell
    Participant

    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

    thanks

You must be logged in to reply to this topic.