Jump to content

Powershell Appx package removal script?

Recommended Posts

I can run multiple commands on powershell as admin on the PC without issue, but when I use the same commands in a Automate script they appear to run, but do not have any affect in many cases.


Here are a few commands that work on the system, but when placed into a automate script fail to work (the priority for me is the first command listed)


Get-ProvisionedAppxPackage -Online | Where-Object { $_.PackageName -match "yourphone" } | ForEach-Object { Remove-ProvisionedAppxPackage -Online -AllUsers -PackageName $_.PackageName }

(The one above is verified that it does work to uninstall from all users, but does not work within Automate)

Get-AppxPackage -Name Microsoft.Microsoft3DViewer | Remove-AppxPackage

(this may be user only)

Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like Microsoft.MicrosoftOfficeHub | Remove-AppxProvisionedPackage -Online

(This may also be user only)


Does anyone have any idea how to make this work?  I have been using powershell as Admin in the Automate script without success in achieving the desired result.




Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...