How to create a batch file that runs multiple PowerShell commands

I am wanting to run multiple "get-appxpackage | remove-appxpackage" commands from a batch file in Windows 10. I'll also need to set the execution policy as remote signed, and the command must be run as administrator to be successful. Can someone explain the structure of the batch file I would need?
Dustin23IT DirectorAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dustin SaundersDirector of OperationsCommented:
Out of curiosity, why not just do this in a single Powershell file?
0
Dustin23IT DirectorAuthor Commented:
I would like it to be one file. Multiple commands in one file.
1
Dustin SaundersDirector of OperationsCommented:
Well, you can call Powershell from bat like this:

Powershell.exe -executionpolicy remotesigned -File  C:\Script\Path\Script.ps1

Open in new window


Then you can pass args in to it that way.  In your script, define the params:

param (
[string]$Variable1
)

Open in new window


And pass the args over to the script.
Powershell.exe -executionpolicy remotesigned -File  C:\Script\Path\Script.ps1 -Variable1 "something"

Open in new window


But if you're doing something in batch, you might as well put all of that into the powershell script.
0
Make Network Traffic Fast and Furious with SD-WAN

Software-defined WAN (SD-WAN) is a technology that determines the most effective way to route traffic to and from datacenter sites. Register for the webinar today to learn how your business can benefit from SD-WAN!

Dustin23IT DirectorAuthor Commented:
I am not familiar with writing PS scripts. Can you show me how I would run multiple "get-appxpackage | remove-appxpackage" commands in that script (if I was to call a .ps1 file)?
0
Sajen JoseCommented:
In addition to what Dustin mentioned regarding launching Powershell script with the required execution policy set, you may want to use the below example structure in your script.

The Get-AppxPackage -AllUsers cmdlet will list out all the Appx packages on your machine and store it in a variable named $AppxPackages, then use a foreach loop to identify the package you want to remove and used the remove-appxpackage cmdlet to remove it. This can be saved as Script.ps1 and invoked using the method suggested by Dustin above with the appropriate execution policy.

If you could share more details regarding what you are trying to achieve, it would be great.

#Get Admin Privileges
If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))

{   
$arguments = "& '" + $myinvocation.mycommand.definition + "'"
Start-Process powershell -Verb runAs -ArgumentList $arguments
Break
}

#List all AppX Packages for all users
$AppXPackages = Get-AppxPackage -AllUsers

#Remove AppX Package named Microsoft.WindowsStore
foreach ($pkg in $AppXPackages)
{
    if ($pkg.Name -eq "Microsoft.WindowsStore")
    {
        Remove-AppxPackage Microsoft.WindowsStore
    }
    else 
    {
        Write-Host "Skipping Package:" $pkg.Name    
    }
}

Open in new window

1
Sajen JoseCommented:
Note: Microsoft.WindowsStore is just an example, replace it with the package name that you want to remove :)
0
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
I've left out the code for checking and force-running elevated as shown in above script (lines 1-12). Core script  for multiple packages would then be
$packages = 'Microsoft.WindowsStore', 'Apple.FruitStore', 'DrHouse.DrugStore'
Get-AppxPackage -AllUsers | ? { $_.Name -in $packages } |
% {
  Remove-AppxPackage $_
}

Open in new window

If you wonder: no, you cannot pipe Get-AppxPackage to Remove-AppxPackage, probably for security reasons.
You cannot use wildcards for the packages the way the script is using them, but I suppose you'll want to have a strict list of packages to remove anyway.
0
Dustin23IT DirectorAuthor Commented:
Awesome guys, I will try this with a small list of Windows apps and get back to you with the results over the weekend.
0
Dustin23IT DirectorAuthor Commented:
Ok, here is what I have for the scripts. Here is the .bat file that calls the .ps1 file:

@echo off

Powershell.exe -executionpolicy remotesigned -File  \\file-share\it\apps\scripts\RemovePackages.ps1

Open in new window


And here is what I have for the called PS file RemovePackages.ps1:

#Get Admin Privileges
If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))

{   
$arguments = "& '" + $myinvocation.mycommand.definition + "'"
Start-Process powershell -Verb runAs -ArgumentList $arguments
Break
}

$packages = 'flaregamesGmbH.RoyalRevolt2_2.7.0.2_x86__g0q0z3kw54rap', 'king.com.CandyCrushSodaSaga_1.84.700.0_x86__kgqvnymyfvs32'
Get-AppxPackage -AllUsers | ? { $_.Name -in $packages } |
% {
  Remove-AppxPackage $_
}

Open in new window



So far, this does not appear to be working. Can you guys see where I went wrong?

There is also another issue I can foresee (once this IS working). The reason I am looking to create this script is to remove unwanted built-in Microsoft applications like games, Pandora, Skype, Weather, Sports, and the like on the Windows 10 PCs in my environment. The issue with listing out the full names, and not being able to use wildcards, is that the full names are not the same on all machines. For example, Candy Crush Soda Saga is installed on 2 machines, but since they are 2 different versions, the full names are different (king.com.CandyCrushSodaSaga_1.84.700.0_x86__kgqvnymyfvs32 versus king.com.CandyCrushSodaSaga_1.104.700.0_x86__kgqvnymyfvs32). How can we account for this in the script so that Candy Crush Soda Saga (for example) gets removed from all machines without having to explicitly list every possible full name that could be in the entire environment?
0
Sajen JoseCommented:
What is the error you receive?

Also just wondering if you can use ? { $_.Name -in $packages }, -in for Where-Object cmdlet (https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-powershell-1.0/ee177028(v=technet.10))
0
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
If you need wildcards, using something like
$packages = 'flaregamesGmbH.RoyalRevolt', 'king.com.CandyCrushSodaSaga'

$pattern = ($packages -join '.*|')+'.*'
Get-AppxPackage -AllUsers | ? { $_.Name -match $pattern } |
% {
  Remove-AppxPackage $_
}

Open in new window

should work - for that part.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Dustin23IT DirectorAuthor Commented:
No error. The package just does not remove.
0
Dustin23IT DirectorAuthor Commented:
Ok Qlemo, your suggestion works for wildcards. Thanks!

Here is what I have discovered when using "-allusers" in the command. I ran a get-appxpackage command for just the current user on my test machine. I did not see RoyalRevolt2 or CandyCrushSodaSaga. So I ran the following:

#Get Admin Privileges
If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))

{   
$arguments = "& '" + $myinvocation.mycommand.definition + "'"
Start-Process powershell -Verb runAs -ArgumentList $arguments
Break
}

$packages = 'Microsoft.Wallet', 'Microsoft.BingWeather'

$pattern = ($packages -join '.*|')+'.*'
Get-AppxPackage -AllUsers | ? { $_.Name -match $pattern } |
% {
  Remove-AppxPackage $_
}

Open in new window


It seemed to work, so I ran a get-appxpackage command again for the current user and both Microsoft.Wallet and Micosoft.BingWeather were gone. However, I then ran a get-appxpackage -allusers command again and noticed that both were again showing. So, what is happening here is either the script is not working for all users, or the get-appxpackage -allusers command shows all default apps, not taking into account the ones that have been removed.

Does anyone have any idea on this? I am going to try logging in to this machine with a different user (that has never logged into this specific machine) then check to see if the 4 removed packages are still there.
0
Dustin23IT DirectorAuthor Commented:
Ok, I just tried this with a new user on the same machine. Running a get-appxpackage command, I still see Microsoft.Wallet and Microsoft.BingWeather. So we can safely conclude at this point that the script works for the current user, but not for all users.
0
Sajen JoseCommented:
You may want to try the below cmdlet to remove the pacakge for all users


Uninstall a single app for all users, type remove-AppxProvisionedPackage [App Package Name]


Link: https://social.technet.microsoft.com/Forums/en-US/1d096aa8-924b-484a-ae92-7757e3029198/powershell-script-to-remove-apps-doesnt-work-for-all-users?forum=win10itprosetup 

Link: http://mywindowshub.com/how-to-remove-default-apps-using-powershell-in-windows-10/
0
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
Your observations are correct. You need to remove the app from the image (once after each major update) with Remove-AppxProvisionedPackage -Online -PackageName $_ instead. And still run the script above for individual users, if I read https://technet.microsoft.com/en-US/library/hh852635.aspx correctly.
0
Dustin23IT DirectorAuthor Commented:
I see, that makes sense. So, basically I need a version of the script that runs once on each PC (or once on an image, if that exists) that removes the undesired apps (Remove-AppxProvisionedPackage -Online -PackageName $_), then another that runs once for each user (or at each logon) that removes the undesired apps from their specific user accounts (Remove-AppxPackage $_). Other than that one command, it looks like the rest of the code should remain the same for both scripts.

I suppose it wouldn't hurt to just have both scripts run at logon, would it? Could I just add another line (Remove-AppxProvisionedPackage -Online -PackageName $_) to the script detailed above so that it looks as follows?:

#Get Admin Privileges
If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))

{   
$arguments = "& '" + $myinvocation.mycommand.definition + "'"
Start-Process powershell -Verb runAs -ArgumentList $arguments
Break
}

$packages = 'Microsoft.Wallet', 'Microsoft.BingWeather'

$pattern = ($packages -join '.*|')+'.*'
Get-AppxPackage -AllUsers | ? { $_.Name -match $pattern } |
% {
  Remove-AppxProvisionedPackage -Online -PackageName $_
  Remove-AppxPackage $_
}

Open in new window


Any idea if this would work? Also, is there any way to make the PS script silent?
0
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
Yes, that is what I would do too ;-).

There is no way to get the Remove-AppxProvisionedPackage to be silent, errors will always been displayed. Best you can do is
  Remove-AppxProvisionedPackage -Online -PackageName $_ | out-null
  Remove-AppxPackage $_  -ea SilentlyContinue | out-null

Open in new window

in the loop.
0
Dustin23IT DirectorAuthor Commented:
Ok awesome, will this effectively close any windows containing errors after they are displayed? It's ok to me if something shows on the screen briefly, but I don't want an error message staying on the screen that freaks my users out.
0
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
This only depends on how you call the script. If the PowerShell console is only fair to run the script, it will close after execution.
0
Dustin23IT DirectorAuthor Commented:
Ok, the way I will most likely call the PS script is from a batch file (as indicated above) set to run at logon as per domain GPO. Would PS console close after execution in this case?
0
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
Yes.
0
Dustin23IT DirectorAuthor Commented:
Ok Qlemo, the last suggestion to make the PS window silent does nothing different than the base script without "|out-null". That's not a big deal since the PS window closes once the script is complete anyway. However, it appears that the

Remove-AppxProvisionedPackage -Online -PackageName $_

Open in new window

line is doing nothing. The apps are removing for the current user, but nothing is removing for all users. Any ideas?
0
Dustin23IT DirectorAuthor Commented:
Here is what I have currently:

#Get Admin Privileges
If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))

{   
$arguments = "& '" + $myinvocation.mycommand.definition + "'"
Start-Process powershell -Verb runAs -ArgumentList $arguments
Break
}

$packages = 'Windows.Photos', 'Microsoft.Xbox', 'Microsoft.WindowsAlarms', 'Microsoft.Zune', 'Microsoft.WindowsSoundRecorder', 'Microsoft.WindowsMaps', 'Microsoft.WindowsFeedbackHub', 'Microsoft.Wallet', 'Microsoft.OneConnect', 'Office.OneNote', 'Microsoft.MicrosoftSolitaireCollection', 'Microsoft.MicrosoftOfficeHub', 'Microsoft.Microsoft3DViewer', 'Microsoft.Messaging', 'Microsoft.Bing', 'Microsoft.3DBuilder', 'Microsoft.Print3D', 'LenovoCorporation.LenovoSettings', 'Microsoft.Getstarted', 'Microsoft.SkypeApp', 'Microsoft.Advertising', 'Microsoft.GetHelp', 'Microsoft.windowscommunicationapps', 'SpotifyAB.SpotifyMusic', 'AutodeskSketchBook', 'Plex', 'MarchofEmpires', 'BubbleWitch3Saga', 'CandyCrushSodaSaga', 'Microsoft.MinecraftUWP', 'Windows.Holographic', 'Windows.ParentalControls'

$pattern = ($packages -join '*.*|')+'.*'
Get-AppxPackage -AllUsers | ? { $_.Name -match $pattern } |
% {
  Remove-AppxProvisionedPackage -Online -PackageName $_
  Remove-AppxPackage $_
}

Open in new window

0
Dustin23IT DirectorAuthor Commented:
I copied the script to the test machine and ran it locally, thinking the PS window would stay open once complete, but it did not. What can I add to keep the window open so I can show you the error messages?

I took some snapshots during the execution, and it looks like there are just a bunch of errors stating the app cannot be removed because it is not installed for the current user.

You can see an example of the error messages here.
So it looks like the Remove-AppxProvisionedPackage -Online -PackageName $_ command is either not being run for each app or is failing and I just haven't seen the error message yet.
0
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
For test, you can add a read-host to script end, which waits for a carriage return.
Or you run PowerShell with the -noExit option.
0
Dustin23IT DirectorAuthor Commented:
Awesome, read-host worked! Here is the full error output:

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CF1, Package was not found.
Windows cannot remove Microsoft.Wallet_1.0.16328.0_x64__8wekyb3d8bbwe because the current user does not have that
package installed. Use Get-AppxPackage to see the list of packages installed.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0002-089f-7a329695d301 in the Event Log or use
the command line Get-AppxLog -ActivityID 327a5fdb-9596-0002-089f-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.Walle...__8wekyb3d8bbwe:String) [Remove-AppxPackage], PSInval
   idOperationException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CF1, Package was not found.
Windows cannot remove Microsoft.Advertising.Xaml_10.1712.5.0_x64__8wekyb3d8bbwe because the current user does not have
that package installed. Use Get-AppxPackage to see the list of packages installed.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0002-149f-7a329695d301 in the Event Log or use
the command line Get-AppxLog -ActivityID 327a5fdb-9596-0002-149f-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.Adver...__8wekyb3d8bbwe:String) [Remove-AppxPackage], PSInval
   idOperationException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CF1, Package was not found.
Windows cannot remove Microsoft.Advertising.Xaml_10.1712.5.0_x86__8wekyb3d8bbwe because the current user does not have
that package installed. Use Get-AppxPackage to see the list of packages installed.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0002-349f-7a329695d301 in the Event Log or use
the command line Get-AppxLog -ActivityID 327a5fdb-9596-0002-349f-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.Adver...__8wekyb3d8bbwe:String) [Remove-AppxPackage], PSInval
   idOperationException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CF1, Package was not found.
Windows cannot remove SpotifyAB.SpotifyMusic_1.70.388.0_x86__zpdnekdrzrea0 because the current user does not have that
package installed. Use Get-AppxPackage to see the list of packages installed.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0002-409f-7a329695d301 in the Event Log or use
the command line Get-AppxLog -ActivityID 327a5fdb-9596-0002-409f-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (SpotifyAB.Spoti...__zpdnekdrzrea0:String) [Remove-AppxPackage], PSInval
   idOperationException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CF1, Package was not found.
Windows cannot remove 89006A2E.AutodeskSketchBook_1.7.0.0_x64__tf1gferkr813w because the current user does not have
that package installed. Use Get-AppxPackage to see the list of packages installed.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0002-519f-7a329695d301 in the Event Log or use
the command line Get-AppxLog -ActivityID 327a5fdb-9596-0002-519f-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (89006A2E.Autode...__tf1gferkr813w:String) [Remove-AppxPackage], PSInval
   idOperationException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CF1, Package was not found.
Windows cannot remove Microsoft.BingNews_4.22.3254.0_x64__8wekyb3d8bbwe because the current user does not have that
package installed. Use Get-AppxPackage to see the list of packages installed.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0002-599f-7a329695d301 in the Event Log or use
the command line Get-AppxLog -ActivityID 327a5fdb-9596-0002-599f-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.BingN...__8wekyb3d8bbwe:String) [Remove-AppxPackage], PSInval
   idOperationException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CF1, Package was not found.
Windows cannot remove CAF9E577.Plex_3.2.20.0_x64__aam28m9va5cke because the current user does not have that package
installed. Use Get-AppxPackage to see the list of packages installed.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0002-689f-7a329695d301 in the Event Log or use
the command line Get-AppxLog -ActivityID 327a5fdb-9596-0002-689f-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (CAF9E577.Plex_3...__aam28m9va5cke:String) [Remove-AppxPackage], PSInval
   idOperationException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CF1, Package was not found.
Windows cannot remove Microsoft.XboxGameOverlay_1.24.5001.0_x64__8wekyb3d8bbwe because the current user does not have
that package installed. Use Get-AppxPackage to see the list of packages installed.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0002-7f9f-7a329695d301 in the Event Log or use
the command line Get-AppxLog -ActivityID 327a5fdb-9596-0002-7f9f-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.XboxG...__8wekyb3d8bbwe:String) [Remove-AppxPackage], PSInval
   idOperationException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CF1, Package was not found.
Windows cannot remove Microsoft.Messaging_3.34.25004.0_x64__8wekyb3d8bbwe because the current user does not have that
package installed. Use Get-AppxPackage to see the list of packages installed.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0002-959f-7a329695d301 in the Event Log or use
the command line Get-AppxLog -ActivityID 327a5fdb-9596-0002-959f-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.Messa...__8wekyb3d8bbwe:String) [Remove-AppxPackage], PSInval
   idOperationException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CF1, Package was not found.
Windows cannot remove Microsoft.WindowsMaps_5.1708.2764.0_x64__8wekyb3d8bbwe because the current user does not have that package installed. Use
Get-AppxPackage to see the list of packages installed.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0006-0b8a-7a329695d301 in the Event Log or use the command line Get-AppxLog
-ActivityID 327a5fdb-9596-0006-0b8a-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.Windo...__8wekyb3d8bbwe:String) [Remove-AppxPackage], PSInvalidOperationException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CF1, Package was not found.
Windows cannot remove Microsoft.Windows.Photos_2017.39101.16720.0_x64__8wekyb3d8bbwe because the current user does not have that package installed. Use
Get-AppxPackage to see the list of packages installed.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0002-bf9f-7a329695d301 in the Event Log or use the command line Get-AppxLog
-ActivityID 327a5fdb-9596-0002-bf9f-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.Windo...__8wekyb3d8bbwe:String) [Remove-AppxPackage], PSInvalidOperationException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CF1, Package was not found.
Windows cannot remove Microsoft.MicrosoftOfficeHub_17.8830.7600.0_x64__8wekyb3d8bbwe because the current user does not have that package installed. Use
Get-AppxPackage to see the list of packages installed.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0002-d49f-7a329695d301 in the Event Log or use the command line Get-AppxLog
-ActivityID 327a5fdb-9596-0002-d49f-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.Micro...__8wekyb3d8bbwe:String) [Remove-AppxPackage], PSInvalidOperationException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CF1, Package was not found.
Windows cannot remove Microsoft.XboxSpeechToTextOverlay_1.21.13002.0_x64__8wekyb3d8bbwe because the current user does not have that package installed. Use
Get-AppxPackage to see the list of packages installed.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0002-fe9f-7a329695d301 in the Event Log or use the command line Get-AppxLog
-ActivityID 327a5fdb-9596-0002-fe9f-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.XboxS...__8wekyb3d8bbwe:String) [Remove-AppxPackage], PSInvalidOperationException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CF1, Package was not found.
Windows cannot remove Microsoft.XboxApp_36.36.12003.0_x64__8wekyb3d8bbwe because the current user does not have that package installed. Use Get-AppxPackage
to see the list of packages installed.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0002-0ca0-7a329695d301 in the Event Log or use the command line Get-AppxLog
-ActivityID 327a5fdb-9596-0002-0ca0-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.XboxA...__8wekyb3d8bbwe:String) [Remove-AppxPackage], PSInvalidOperationException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CF1, Package was not found.
Windows cannot remove Microsoft.3DBuilder_15.1.3342.0_x64__8wekyb3d8bbwe because the current user does not have that package installed. Use Get-AppxPackage
to see the list of packages installed.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0002-21a0-7a329695d301 in the Event Log or use the command line Get-AppxLog
-ActivityID 327a5fdb-9596-0002-21a0-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.3DBui...__8wekyb3d8bbwe:String) [Remove-AppxPackage], PSInvalidOperationException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CF1, Package was not found.
Windows cannot remove Microsoft.BingWeather_4.22.3254.0_x64__8wekyb3d8bbwe because the current user does not have that package installed. Use
Get-AppxPackage to see the list of packages installed.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0002-29a0-7a329695d301 in the Event Log or use the command line Get-AppxLog
-ActivityID 327a5fdb-9596-0002-29a0-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.BingW...__8wekyb3d8bbwe:String) [Remove-AppxPackage], PSInvalidOperationException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CF1, Package was not found.
Windows cannot remove LenovoCorporation.LenovoSettings_3.177.0.0_x86__4642shxvsv8s2 because the current user does not have that package installed. Use
Get-AppxPackage to see the list of packages installed.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0002-3ca0-7a329695d301 in the Event Log or use the command line Get-AppxLog
-ActivityID 327a5fdb-9596-0002-3ca0-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (LenovoCorporati...__4642shxvsv8s2:String) [Remove-AppxPackage], PSInvalidOperationException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CF1, Package was not found.
Windows cannot remove Microsoft.Office.OneNote_17.8827.20991.0_x64__8wekyb3d8bbwe because the current user does not have that package installed. Use
Get-AppxPackage to see the list of packages installed.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0002-46a0-7a329695d301 in the Event Log or use the command line Get-AppxLog
-ActivityID 327a5fdb-9596-0002-46a0-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.Offic...__8wekyb3d8bbwe:String) [Remove-AppxPackage], PSInvalidOperationException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CF1, Package was not found.
Windows cannot remove Microsoft.ZuneVideo_10.17112.13411.0_x64__8wekyb3d8bbwe because the current user does not have that package installed. Use
Get-AppxPackage to see the list of packages installed.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0002-5aa0-7a329695d301 in the Event Log or use the command line Get-AppxLog
-ActivityID 327a5fdb-9596-0002-5aa0-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.ZuneV...__8wekyb3d8bbwe:String) [Remove-AppxPackage], PSInvalidOperationException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CF1, Package was not found.
Windows cannot remove Microsoft.Microsoft3DViewer_2.1801.4012.0_x64__8wekyb3d8bbwe because the current user does not have that package installed. Use
Get-AppxPackage to see the list of packages installed.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0002-6da0-7a329695d301 in the Event Log or use the command line Get-AppxLog
-ActivityID 327a5fdb-9596-0002-6da0-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.Micro...__8wekyb3d8bbwe:String) [Remove-AppxPackage], PSInvalidOperationException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CF1, Package was not found.
Windows cannot remove Microsoft.ZuneMusic_10.17086.24711.0_x64__8wekyb3d8bbwe because the current user does not have that package installed. Use
Get-AppxPackage to see the list of packages installed.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0002-91a0-7a329695d301 in the Event Log or use the command line Get-AppxLog
-ActivityID 327a5fdb-9596-0002-91a0-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.ZuneM...__8wekyb3d8bbwe:String) [Remove-AppxPackage], PSInvalidOperationException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CF1, Package was not found.
Windows cannot remove Microsoft.WindowsFeedbackHub_1.1711.3412.0_x64__8wekyb3d8bbwe because the current user does not have that package installed. Use
Get-AppxPackage to see the list of packages installed.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0002-a1a0-7a329695d301 in the Event Log or use the command line Get-AppxLog
-ActivityID 327a5fdb-9596-0002-a1a0-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.Windo...__8wekyb3d8bbwe:String) [Remove-AppxPackage], PSInvalidOperationException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CF1, Package was not found.
Windows cannot remove Microsoft.MicrosoftSolitaireCollection_3.18.12091.0_x64__8wekyb3d8bbwe because the current user does not have that package installed.
Use Get-AppxPackage to see the list of packages installed.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0002-a6a0-7a329695d301 in the Event Log or use the command line Get-AppxLog
-ActivityID 327a5fdb-9596-0002-a6a0-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.Micro...__8wekyb3d8bbwe:String) [Remove-AppxPackage], PSInvalidOperationException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CF1, Package was not found.
Windows cannot remove A278AB0D.MarchofEmpires_2.9.2.1_x86__h6adky7gbf63m because the current user does not have that package installed. Use Get-AppxPackage
to see the list of packages installed.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0002-b6a0-7a329695d301 in the Event Log or use the command line Get-AppxLog
-ActivityID 327a5fdb-9596-0002-b6a0-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (A278AB0D.Marcho...__h6adky7gbf63m:String) [Remove-AppxPackage], PSInvalidOperationException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CF1, Package was not found.
Windows cannot remove king.com.BubbleWitch3Saga_4.1.3.0_x86__kgqvnymyfvs32 because the current user does not have that package installed. Use
Get-AppxPackage to see the list of packages installed.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0002-c5a0-7a329695d301 in the Event Log or use the command line Get-AppxLog
-ActivityID 327a5fdb-9596-0002-c5a0-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (king.com.Bubble...__kgqvnymyfvs32:String) [Remove-AppxPackage], PSInvalidOperationException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CF1, Package was not found.
Windows cannot remove king.com.CandyCrushSodaSaga_1.104.700.0_x86__kgqvnymyfvs32 because the current user does not have that package installed. Use
Get-AppxPackage to see the list of packages installed.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0002-d8a0-7a329695d301 in the Event Log or use the command line Get-AppxLog
-ActivityID 327a5fdb-9596-0002-d8a0-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (king.com.CandyC...__kgqvnymyfvs32:String) [Remove-AppxPackage], PSInvalidOperationException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CF1, Package was not found.
Windows cannot remove Microsoft.MinecraftUWP_1.2.800.0_x64__8wekyb3d8bbwe because the current user does not have that package installed. Use Get-AppxPackage
to see the list of packages installed.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0002-e7a0-7a329695d301 in the Event Log or use the command line Get-AppxLog
-ActivityID 327a5fdb-9596-0002-e7a0-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.Minec...__8wekyb3d8bbwe:String) [Remove-AppxPackage], PSInvalidOperationException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CFA, Removal failed. Please contact your software vendor. (Exception from HRESULT: 0x80073CFA)
error 0x80070032: AppX Deployment Remove operation on package Microsoft.Windows.HolographicFirstRun_10.0.16299.125_neutral_neutral_cw5n1h2txyewy from:
C:\Windows\SystemApps\Microsoft.Windows.HolographicFirstRun_cw5n1h2txyewy failed. This app is part of Windows and cannot be uninstalled on a per-user basis.
An administrator can attempt to remove the app from the computer using Turn Windows Features on or off. However, it may not be possible to uninstall the app.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0002-10a1-7a329695d301 in the Event Log or use the command line Get-AppxLog
-ActivityID 327a5fdb-9596-0002-10a1-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (Microsoft.Windo...l_cw5n1h2txyewy:String) [Remove-AppxPackage], IOException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CFA, Removal failed. Please contact your software vendor. (Exception from HRESULT: 0x80073CFA)
error 0x80070032: AppX Deployment Remove operation on package Microsoft.Windows.ParentalControls_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy from:
C:\Windows\SystemApps\ParentalControls_cw5n1h2txyewy failed. This app is part of Windows and cannot be uninstalled on a per-user basis. An administrator can
attempt to remove the app from the computer using Turn Windows Features on or off. However, it may not be possible to uninstall the app.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0002-38a1-7a329695d301 in the Event Log or use the command line Get-AppxLog
-ActivityID 327a5fdb-9596-0002-38a1-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (Microsoft.Windo...l_cw5n1h2txyewy:String) [Remove-AppxPackage], IOException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CFA, Removal failed. Please contact your software vendor. (Exception from HRESULT: 0x80073CFA)
error 0x80070032: AppX Deployment Remove operation on package Microsoft.Windows.PeopleExperienceHost_10.0.16299.15_neutral_neutral_cw5n1h2txyewy from:
C:\Windows\SystemApps\Microsoft.Windows.PeopleExperienceHost_cw5n1h2txyewy failed. This app is part of Windows and cannot be uninstalled on a per-user
basis. An administrator can attempt to remove the app from the computer using Turn Windows Features on or off. However, it may not be possible to uninstall
the app.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0002-42a1-7a329695d301 in the Event Log or use the command line Get-AppxLog
-ActivityID 327a5fdb-9596-0002-42a1-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (Microsoft.Windo...l_cw5n1h2txyewy:String) [Remove-AppxPackage], IOException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CFA, Removal failed. Please contact your software vendor. (Exception from HRESULT: 0x80073CFA)
error 0x80070032: AppX Deployment Remove operation on package Microsoft.XboxGameCallableUI_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy from:
C:\Windows\SystemApps\Microsoft.XboxGameCallableUI_cw5n1h2txyewy failed. This app is part of Windows and cannot be uninstalled on a per-user basis. An
administrator can attempt to remove the app from the computer using Turn Windows Features on or off. However, it may not be possible to uninstall the app.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0002-57a1-7a329695d301 in the Event Log or use the command line Get-AppxLog
-ActivityID 327a5fdb-9596-0002-57a1-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (Microsoft.XboxG...l_cw5n1h2txyewy:String) [Remove-AppxPackage], IOException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CF1, Package was not found.
Windows cannot remove Microsoft.XboxIdentityProvider_12.30.5001.0_x64__8wekyb3d8bbwe because the current user does not have that package installed. Use
Get-AppxPackage to see the list of packages installed.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0002-61a1-7a329695d301 in the Event Log or use the command line Get-AppxLog
-ActivityID 327a5fdb-9596-0002-61a1-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.XboxI...__8wekyb3d8bbwe:String) [Remove-AppxPackage], PSInvalidOperationException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CF1, Package was not found.
Windows cannot remove Microsoft.Xbox.TCUI_1.11.29001.0_x64__8wekyb3d8bbwe because the current user does not have that package installed. Use Get-AppxPackage
to see the list of packages installed.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0004-f5cd-7a329695d301 in the Event Log or use the command line Get-AppxLog
-ActivityID 327a5fdb-9596-0004-f5cd-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.Xbox....__8wekyb3d8bbwe:String) [Remove-AppxPackage], PSInvalidOperationException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CF1, Package was not found.
Windows cannot remove Microsoft.WindowsAlarms_10.1712.3352.0_x64__8wekyb3d8bbwe because the current user does not have that package installed. Use
Get-AppxPackage to see the list of packages installed.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0002-99a1-7a329695d301 in the Event Log or use the command line Get-AppxLog
-ActivityID 327a5fdb-9596-0002-99a1-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.Windo...__8wekyb3d8bbwe:String) [Remove-AppxPackage], PSInvalidOperationException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CF1, Package was not found.
Windows cannot remove Microsoft.WindowsSoundRecorder_10.1712.3351.0_x64__8wekyb3d8bbwe because the current user does not have that package installed. Use
Get-AppxPackage to see the list of packages installed.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0006-808a-7a329695d301 in the Event Log or use the command line Get-AppxLog
-ActivityID 327a5fdb-9596-0006-808a-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.Windo...__8wekyb3d8bbwe:String) [Remove-AppxPackage], PSInvalidOperationException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CF1, Package was not found.
Windows cannot remove Microsoft.People_10.3.3472.0_x64__8wekyb3d8bbwe because the current user does not have that package installed. Use Get-AppxPackage to
see the list of packages installed.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0002-cfa1-7a329695d301 in the Event Log or use the command line Get-AppxLog
-ActivityID 327a5fdb-9596-0002-cfa1-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.Peopl...__8wekyb3d8bbwe:String) [Remove-AppxPackage], PSInvalidOperationException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CF1, Package was not found.
Windows cannot remove Microsoft.OneConnect_3.1710.3044.0_x64__8wekyb3d8bbwe because the current user does not have that package installed. Use
Get-AppxPackage to see the list of packages installed.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0002-e1a1-7a329695d301 in the Event Log or use the command line Get-AppxLog
-ActivityID 327a5fdb-9596-0002-e1a1-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.OneCo...__8wekyb3d8bbwe:String) [Remove-AppxPackage], PSInvalidOperationException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CFA, Removal failed. Please contact your software vendor.
Deployment DeStage operation with target volume C: on Package Microsoft.Print3D_2.0.3621.0_x64__8wekyb3d8bbwe from:   failed with error 0x80070490. See
http://go.microsoft.com/fwlink/?LinkId=235160 for help diagnosing app deployment issues.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0002-f0a1-7a329695d301 in the Event Log or use the command line Get-AppxLog
-ActivityID 327a5fdb-9596-0002-f0a1-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (Microsoft.Print...__8wekyb3d8bbwe:String) [Remove-AppxPackage], IOException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CFA, Removal failed. Please contact your software vendor.
Deployment DeStage operation with target volume C: on Package Microsoft.Getstarted_6.7.3462.0_x64__8wekyb3d8bbwe from:   failed with error 0x80070490. See
http://go.microsoft.com/fwlink/?LinkId=235160 for help diagnosing app deployment issues.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0002-3da2-7a329695d301 in the Event Log or use the command line Get-AppxLog
-ActivityID 327a5fdb-9596-0002-3da2-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (Microsoft.Getst...__8wekyb3d8bbwe:String) [Remove-AppxPackage], IOException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CFA, Removal failed. Please contact your software vendor.
Deployment DeStage operation with target volume C: on Package Microsoft.SkypeApp_12.13.274.0_x64__kzf8qxf38zg5c from:   failed with error 0x80070490. See
http://go.microsoft.com/fwlink/?LinkId=235160 for help diagnosing app deployment issues.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0006-ad8a-7a329695d301 in the Event Log or use the command line Get-AppxLog
-ActivityID 327a5fdb-9596-0006-ad8a-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (Microsoft.Skype...__kzf8qxf38zg5c:String) [Remove-AppxPackage], IOException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxProvisionedPackage : The system cannot find the file specified.
At C:\Users\Administrator\Desktop\RemovePackages.ps1:15 char:3
+   Remove-AppxProvisionedPackage -Online -PackageName $_
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CFA, Removal failed. Please contact your software vendor.
Deployment DeStage operation with target volume C: on Package Microsoft.GetHelp_10.1706.3471.0_x64__8wekyb3d8bbwe from:   failed with error 0x80070490. See
http://go.microsoft.com/fwlink/?LinkId=235160 for help diagnosing app deployment issues.
NOTE: For additional information, look for [ActivityId] 327a5fdb-9596-0002-5ea2-7a329695d301 in the Event Log or use the command line Get-AppxLog
-ActivityID 327a5fdb-9596-0002-5ea2-7a329695d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:16 char:3
+   Remove-AppxPackage $_
+   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (Microsoft.GetHe...__8wekyb3d8bbwe:String) [Remove-AppxPackage], IOException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Open in new window

0
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
No need to post all that stuff, a snippet would have been sufficient ;-).
And please use CODE blocks if pasting code and logs. I've changed your comment that way.
0
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
I see, we need to use different approaches for users and the OS image
#Get Admin Privileges
If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))

{   
$arguments = "& '" + $myinvocation.mycommand.definition + "'"
Start-Process powershell -Verb runAs -ArgumentList $arguments
Break
}

$packages = 'Windows.Photos', 'Microsoft.Xbox', 'Microsoft.WindowsAlarms', 'Microsoft.Zune', 'Microsoft.WindowsSoundRecorder', 'Microsoft.WindowsMaps', 'Microsoft.WindowsFeedbackHub', 'Microsoft.Wallet', 'Microsoft.OneConnect', 'Office.OneNote', 'Microsoft.MicrosoftSolitaireCollection', 'Microsoft.MicrosoftOfficeHub', 'Microsoft.Microsoft3DViewer', 'Microsoft.Messaging', 'Microsoft.Bing', 'Microsoft.3DBuilder', 'Microsoft.Print3D', 'LenovoCorporation.LenovoSettings', 'Microsoft.Getstarted', 'Microsoft.SkypeApp', 'Microsoft.Advertising', 'Microsoft.GetHelp', 'Microsoft.windowscommunicationapps', 'SpotifyAB.SpotifyMusic', 'AutodeskSketchBook', 'Plex', 'MarchofEmpires', 'BubbleWitch3Saga', 'CandyCrushSodaSaga', 'Microsoft.MinecraftUWP', 'Windows.Holographic', 'Windows.ParentalControls'

$pattern = ($packages -join '*.*|')+'.*'
Get-AppxPackage                    | ? { $_.Name -match $pattern } | % { Remove-AppxPackage $_ }
Get-AppxProvisionedPackage -Online | ? { $_.Name -match $pattern } | % { Remove-AppxProvisionedPackage -Online -PackageName $_ }

Open in new window

0
Dustin23IT DirectorAuthor Commented:
Sorry, I almost used code blocks. Thanks for fixing.

Ok we have to use different "GET" commands. Makes sense. I will give this a try now.
0
Dustin23IT DirectorAuthor Commented:
This is the entire output I get when running the new script. It completes in only a few seconds, so I think it's quite easy to say that the whole script is not running.

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CFA, Removal failed. Please contact your software vendor.
(Exception from HRESULT: 0x80073CFA)
error 0x80070032: AppX Deployment Remove operation on package
Microsoft.XboxGameCallableUI_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy from:
C:\Windows\SystemApps\Microsoft.XboxGameCallableUI_cw5n1h2txyewy failed. This app is part of Windows and cannot be
uninstalled on a per-user basis. An administrator can attempt to remove the app from the computer using Turn Windows
Features on or off. However, it may not be possible to uninstall the app.
NOTE: For additional information, look for [ActivityId] 568882c2-962c-0000-6991-88562c96d301 in the Event Log or use
the command line Get-AppxLog -ActivityID 568882c2-962c-0000-6991-88562c96d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:13 char:74
+ ...         | ? { $_.Name -match $pattern } | % { Remove-AppxPackage $_ }
+                                                   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (Microsoft.XboxG...l_cw5n1h2txyewy:String) [Remove-AppxPackage], IOException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CFA, Removal failed. Please contact your software vendor.
(Exception from HRESULT: 0x80073CFA)
error 0x80070032: AppX Deployment Remove operation on package
Microsoft.Windows.ParentalControls_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy from:
C:\Windows\SystemApps\ParentalControls_cw5n1h2txyewy failed. This app is part of Windows and cannot be uninstalled on
a per-user basis. An administrator can attempt to remove the app from the computer using Turn Windows Features on or
off. However, it may not be possible to uninstall the app.
NOTE: For additional information, look for [ActivityId] 568882c2-962c-0006-5694-88562c96d301 in the Event Log or use
the command line Get-AppxLog -ActivityID 568882c2-962c-0006-5694-88562c96d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:13 char:74
+ ...         | ? { $_.Name -match $pattern } | % { Remove-AppxPackage $_ }
+                                                   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (Microsoft.Windo...l_cw5n1h2txyewy:String) [Remove-AppxPackage], IOException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CFA, Removal failed. Please contact your software vendor.
(Exception from HRESULT: 0x80073CFA)
error 0x80070032: AppX Deployment Remove operation on package
Microsoft.Windows.HolographicFirstRun_10.0.16299.125_neutral_neutral_cw5n1h2txyewy from:
C:\Windows\SystemApps\Microsoft.Windows.HolographicFirstRun_cw5n1h2txyewy failed. This app is part of Windows and
cannot be uninstalled on a per-user basis. An administrator can attempt to remove the app from the computer using Turn
Windows Features on or off. However, it may not be possible to uninstall the app.
NOTE: For additional information, look for [ActivityId] 568882c2-962c-0006-5794-88562c96d301 in the Event Log or use
the command line Get-AppxLog -ActivityID 568882c2-962c-0006-5794-88562c96d301
At C:\Users\Administrator\Desktop\RemovePackages.ps1:13 char:74
+ ...         | ? { $_.Name -match $pattern } | % { Remove-AppxPackage $_ }
+                                                   ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (Microsoft.Windo...l_cw5n1h2txyewy:String) [Remove-AppxPackage], IOException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

Open in new window

0
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
If you look at the error messages, there ate three packages not removable from users, only from image. The script works.
0
Dustin23IT DirectorAuthor Commented:
Nothing is removing though Qlemo.

I ran the script again after commenting out
Get-AppxPackage                    | ? { $_.Name -match $pattern } | % { Remove-AppxPackage $_ }

Open in new window


I am now looking at a blank  PS screen. Nothing has happened, and screen stays open. Respectfully, the line
Get-AppxProvisionedPackage -Online | ? { $_.Name -match $pattern } | % { Remove-AppxProvisionedPackage -Online -PackageName $_ }

Open in new window

does not appear to be working.
0
Dustin23IT DirectorAuthor Commented:
The reason I am getting the errors I posted earlier, it seems, is that everything in the $packages list that could possibly be removed for the current user has already done so. Now the issue is getting apps removed for all users.
1
Dustin23IT DirectorAuthor Commented:
Apoloigies, I still had read-host included at the end of the script. Running without that line now concludes with a brief PS window open and close. Nothing appears to happen and apps are still in tact.
0
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
The apps should be gone for the user after logging out. The effect might not be visible in the active session.
0
Dustin23IT DirectorAuthor Commented:
After a reboot, this is what I am still seeing:

PS C:\Users\Administrator> get-appxpackage -allusers | select name, packagefullname

Name                                        PackageFullName
----                                        ---------------
Microsoft.Windows.SecondaryTileExperience   Microsoft.Windows.SecondaryTileExperience_10.0.0.0_neutral__cw5n1h2txyewy
Windows.MiracastView                        Windows.MiracastView_6.3.0.0_neutral_neutral_cw5n1h2txyewy
Windows.PrintDialog                         Windows.PrintDialog_6.2.0.0_neutral_neutral_cw5n1h2txyewy
Microsoft.NET.Native.Runtime.1.4            Microsoft.NET.Native.Runtime.1.4_1.4.24201.0_x86__8wekyb3d8bbwe
Microsoft.NET.Native.Runtime.1.4            Microsoft.NET.Native.Runtime.1.4_1.4.24201.0_x64__8wekyb3d8bbwe
Microsoft.NET.Native.Framework.1.3          Microsoft.NET.Native.Framework.1.3_1.3.24201.0_x86__8wekyb3d8bbwe
Microsoft.NET.Native.Framework.1.3          Microsoft.NET.Native.Framework.1.3_1.3.24201.0_x64__8wekyb3d8bbwe
Microsoft.NET.Native.Runtime.1.3            Microsoft.NET.Native.Runtime.1.3_1.3.23901.0_x64__8wekyb3d8bbwe
Microsoft.NET.Native.Runtime.1.3            Microsoft.NET.Native.Runtime.1.3_1.3.23901.0_x86__8wekyb3d8bbwe
Microsoft.Wallet                            Microsoft.Wallet_1.0.16328.0_x64__8wekyb3d8bbwe
Microsoft.Advertising.Xaml                  Microsoft.Advertising.Xaml_10.1712.5.0_x64__8wekyb3d8bbwe
Microsoft.Advertising.Xaml                  Microsoft.Advertising.Xaml_10.1712.5.0_x86__8wekyb3d8bbwe
SpotifyAB.SpotifyMusic                      SpotifyAB.SpotifyMusic_1.70.388.0_x86__zpdnekdrzrea0
89006A2E.AutodeskSketchBook                 89006A2E.AutodeskSketchBook_1.7.0.0_x64__tf1gferkr813w
Microsoft.BingNews                          Microsoft.BingNews_4.22.3254.0_x64__8wekyb3d8bbwe
CAF9E577.Plex                               CAF9E577.Plex_3.2.20.0_x64__aam28m9va5cke
Microsoft.NET.Native.Runtime.1.6            Microsoft.NET.Native.Runtime.1.6_1.6.24903.0_x86__8wekyb3d8bbwe
Microsoft.NET.Native.Runtime.1.6            Microsoft.NET.Native.Runtime.1.6_1.6.24903.0_x64__8wekyb3d8bbwe
Microsoft.NET.Native.Framework.1.6          Microsoft.NET.Native.Framework.1.6_1.6.24903.0_x86__8wekyb3d8bbwe
Microsoft.NET.Native.Framework.1.6          Microsoft.NET.Native.Framework.1.6_1.6.24903.0_x64__8wekyb3d8bbwe
Microsoft.VCLibs.140.00                     Microsoft.VCLibs.140.00_14.0.25426.0_x86__8wekyb3d8bbwe
Microsoft.VCLibs.140.00                     Microsoft.VCLibs.140.00_14.0.25426.0_x64__8wekyb3d8bbwe
Microsoft.Services.Store.Engagement         Microsoft.Services.Store.Engagement_10.0.17112.0_x86__8wekyb3d8bbwe
Microsoft.Services.Store.Engagement         Microsoft.Services.Store.Engagement_10.0.17112.0_x64__8wekyb3d8bbwe
Microsoft.XboxGameOverlay                   Microsoft.XboxGameOverlay_1.24.5001.0_x64__8wekyb3d8bbwe
Microsoft.Messaging                         Microsoft.Messaging_3.34.25004.0_x64__8wekyb3d8bbwe
Microsoft.MSPaint                           Microsoft.MSPaint_3.1712.7027.0_x64__8wekyb3d8bbwe
Microsoft.WindowsMaps                       Microsoft.WindowsMaps_5.1708.2764.0_x64__8wekyb3d8bbwe
Microsoft.Windows.Photos                    Microsoft.Windows.Photos_2017.39101.16720.0_x64__8wekyb3d8bbwe
Microsoft.MicrosoftOfficeHub                Microsoft.MicrosoftOfficeHub_17.8830.7600.0_x64__8wekyb3d8bbwe
Microsoft.XboxSpeechToTextOverlay           Microsoft.XboxSpeechToTextOverlay_1.21.13002.0_x64__8wekyb3d8bbwe
Microsoft.XboxApp                           Microsoft.XboxApp_36.36.12003.0_x64__8wekyb3d8bbwe
Microsoft.3DBuilder                         Microsoft.3DBuilder_15.1.3342.0_x64__8wekyb3d8bbwe
Microsoft.BingWeather                       Microsoft.BingWeather_4.22.3254.0_x64__8wekyb3d8bbwe
E046963F.LenovoCompanion                    E046963F.LenovoCompanion_4.8.255.0_x86__k1h2ywk1493x8
LenovoCorporation.LenovoSettings            LenovoCorporation.LenovoSettings_3.177.0.0_x86__4642shxvsv8s2
Microsoft.DesktopAppInstaller               Microsoft.DesktopAppInstaller_1.0.12894.0_x64__8wekyb3d8bbwe
Microsoft.NET.Native.Runtime.1.7            Microsoft.NET.Native.Runtime.1.7_1.7.25531.0_x86__8wekyb3d8bbwe
Microsoft.Office.OneNote                    Microsoft.Office.OneNote_17.8827.20991.0_x64__8wekyb3d8bbwe
Microsoft.NET.Native.Runtime.1.7            Microsoft.NET.Native.Runtime.1.7_1.7.25531.0_x64__8wekyb3d8bbwe
Microsoft.NET.Native.Framework.1.7          Microsoft.NET.Native.Framework.1.7_1.7.25531.0_x64__8wekyb3d8bbwe
Microsoft.NET.Native.Framework.1.7          Microsoft.NET.Native.Framework.1.7_1.7.25531.0_x86__8wekyb3d8bbwe
Microsoft.ZuneVideo                         Microsoft.ZuneVideo_10.17112.13411.0_x64__8wekyb3d8bbwe
Microsoft.VCLibs.140.00.UWPDesktop          Microsoft.VCLibs.140.00.UWPDesktop_14.0.25426.0_x86__8wekyb3d8bbwe
Microsoft.VCLibs.140.00.UWPDesktop          Microsoft.VCLibs.140.00.UWPDesktop_14.0.25426.0_x64__8wekyb3d8bbwe
Microsoft.MicrosoftStickyNotes              Microsoft.MicrosoftStickyNotes_2.0.5.0_x64__8wekyb3d8bbwe
Microsoft.Microsoft3DViewer                 Microsoft.Microsoft3DViewer_2.1801.4012.0_x64__8wekyb3d8bbwe
Microsoft.ZuneMusic                         Microsoft.ZuneMusic_10.17086.24711.0_x64__8wekyb3d8bbwe
Microsoft.WindowsFeedbackHub                Microsoft.WindowsFeedbackHub_1.1711.3412.0_x64__8wekyb3d8bbwe
Microsoft.MicrosoftSolitaireCollection      Microsoft.MicrosoftSolitaireCollection_3.18.12091.0_x64__8wekyb3d8bbwe
Microsoft.VCLibs.120.00                     Microsoft.VCLibs.120.00_12.0.21005.1_x64__8wekyb3d8bbwe
Microsoft.VCLibs.120.00                     Microsoft.VCLibs.120.00_12.0.21005.1_x86__8wekyb3d8bbwe
A278AB0D.MarchofEmpires                     A278AB0D.MarchofEmpires_2.9.2.1_x86__h6adky7gbf63m
king.com.BubbleWitch3Saga                   king.com.BubbleWitch3Saga_4.1.3.0_x86__kgqvnymyfvs32
king.com.CandyCrushSodaSaga                 king.com.CandyCrushSodaSaga_1.104.700.0_x86__kgqvnymyfvs32
Microsoft.MinecraftUWP                      Microsoft.MinecraftUWP_1.2.800.0_x64__8wekyb3d8bbwe
1527c705-839a-4832-9118-54d4Bd6a0c89        1527c705-839a-4832-9118-54d4Bd6a0c89_10.0.16299.15_neutral_neutral_cw5n1h2txyewy
c5e2524a-ea46-4f67-841f-6a9465d9d515        c5e2524a-ea46-4f67-841f-6a9465d9d515_10.0.16299.15_neutral_neutral_cw5n1h2txyewy
E2A4F912-2574-4A75-9BB0-0D023378592B        E2A4F912-2574-4A75-9BB0-0D023378592B_10.0.16299.15_neutral_neutral_cw5n1h2txyewy
F46D4000-FD22-4DB4-AC8E-4E1DDDE828FE        F46D4000-FD22-4DB4-AC8E-4E1DDDE828FE_10.0.16299.15_neutral_neutral_cw5n1h2txyewy
InputApp                                    InputApp_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy
Microsoft.AAD.BrokerPlugin                  Microsoft.AAD.BrokerPlugin_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy
Microsoft.AccountsControl                   Microsoft.AccountsControl_10.0.16299.15_neutral__cw5n1h2txyewy
Microsoft.BioEnrollment                     Microsoft.BioEnrollment_10.0.16299.15_neutral__cw5n1h2txyewy
Microsoft.CredDialogHost                    Microsoft.CredDialogHost_10.0.16299.15_neutral__cw5n1h2txyewy
Microsoft.ECApp                             Microsoft.ECApp_10.0.16299.15_neutral__8wekyb3d8bbwe
Microsoft.LockApp                           Microsoft.LockApp_10.0.16299.15_neutral__cw5n1h2txyewy
Microsoft.MicrosoftEdge                     Microsoft.MicrosoftEdge_41.16299.15.0_neutral__8wekyb3d8bbwe
Microsoft.PPIProjection                     Microsoft.PPIProjection_10.0.16299.15_neutral_neutral_cw5n1h2txyewy
Microsoft.Windows.Apprep.ChxApp             Microsoft.Windows.Apprep.ChxApp_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy
Microsoft.Windows.AssignedAccessLockApp     Microsoft.Windows.AssignedAccessLockApp_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy
Microsoft.Windows.CloudExperienceHost       Microsoft.Windows.CloudExperienceHost_10.0.16299.15_neutral_neutral_cw5n1h2txyewy
Microsoft.Windows.ContentDeliveryManager    Microsoft.Windows.ContentDeliveryManager_10.0.16299.15_neutral_neutral_cw5n1h2txyewy
Microsoft.Windows.Cortana                   Microsoft.Windows.Cortana_1.9.6.16299_neutral_neutral_cw5n1h2txyewy
Microsoft.Windows.HolographicFirstRun       Microsoft.Windows.HolographicFirstRun_10.0.16299.125_neutral_neutral_cw5n1h2txyewy
Microsoft.Windows.OOBENetworkCaptivePortal  Microsoft.Windows.OOBENetworkCaptivePortal_10.0.16299.15_neutral__cw5n1h2txyewy
Microsoft.Windows.OOBENetworkConnectionFlow Microsoft.Windows.OOBENetworkConnectionFlow_10.0.16299.15_neutral__cw5n1h2txyewy
Microsoft.Windows.ParentalControls          Microsoft.Windows.ParentalControls_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy
Microsoft.Windows.PeopleExperienceHost      Microsoft.Windows.PeopleExperienceHost_10.0.16299.15_neutral_neutral_cw5n1h2txyewy
Microsoft.Windows.PinningConfirmationDialog Microsoft.Windows.PinningConfirmationDialog_1000.16299.15.0_neutral__cw5n1h2txyewy
Microsoft.Windows.SecHealthUI               Microsoft.Windows.SecHealthUI_10.0.16299.15_neutral__cw5n1h2txyewy
Microsoft.Windows.SecureAssessmentBrowser   Microsoft.Windows.SecureAssessmentBrowser_10.0.16299.15_neutral_neutral_cw5n1h2txyewy
Microsoft.Windows.ShellExperienceHost       Microsoft.Windows.ShellExperienceHost_10.0.16299.15_neutral_neutral_cw5n1h2txyewy
Microsoft.XboxGameCallableUI                Microsoft.XboxGameCallableUI_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy
windows.immersivecontrolpanel               windows.immersivecontrolpanel_10.0.1.1000_neutral_neutral_cw5n1h2txyewy
Microsoft.Services.Store.Engagement         Microsoft.Services.Store.Engagement_10.0.1610.0_x64__8wekyb3d8bbwe
Microsoft.Services.Store.Engagement         Microsoft.Services.Store.Engagement_10.0.1610.0_x86__8wekyb3d8bbwe
Microsoft.VCLibs.140.00                     Microsoft.VCLibs.140.00_14.0.24605.0_x64__8wekyb3d8bbwe
Microsoft.VCLibs.140.00                     Microsoft.VCLibs.140.00_14.0.24605.0_x86__8wekyb3d8bbwe
Microsoft.XboxIdentityProvider              Microsoft.XboxIdentityProvider_12.30.5001.0_x64__8wekyb3d8bbwe
A278AB0D.DisneyMagicKingdoms                A278AB0D.DisneyMagicKingdoms_2.6.0.9_x86__h6adky7gbf63m
Microsoft.WindowsCalculator                 Microsoft.WindowsCalculator_10.1712.3351.0_x64__8wekyb3d8bbwe
Microsoft.Xbox.TCUI                         Microsoft.Xbox.TCUI_1.11.29001.0_x64__8wekyb3d8bbwe
Microsoft.WindowsAlarms                     Microsoft.WindowsAlarms_10.1712.3352.0_x64__8wekyb3d8bbwe
Microsoft.WindowsSoundRecorder              Microsoft.WindowsSoundRecorder_10.1712.3351.0_x64__8wekyb3d8bbwe
Microsoft.People                            Microsoft.People_10.3.3472.0_x64__8wekyb3d8bbwe
Microsoft.HEVCVideoExtension                Microsoft.HEVCVideoExtension_1.0.10084.0_x64__8wekyb3d8bbwe
Microsoft.OneConnect                        Microsoft.OneConnect_3.1710.3044.0_x64__8wekyb3d8bbwe
Microsoft.Print3D                           Microsoft.Print3D_2.0.3621.0_x64__8wekyb3d8bbwe
Microsoft.Advertising.Xaml                  Microsoft.Advertising.Xaml_10.1801.1.0_x64__8wekyb3d8bbwe
Microsoft.Advertising.Xaml                  Microsoft.Advertising.Xaml_10.1801.1.0_x86__8wekyb3d8bbwe
Microsoft.WindowsCamera                     Microsoft.WindowsCamera_2017.1117.10.0_x64__8wekyb3d8bbwe
Microsoft.StorePurchaseApp                  Microsoft.StorePurchaseApp_11712.1801.10002.0_x64__8wekyb3d8bbwe
Microsoft.Getstarted                        Microsoft.Getstarted_6.7.3462.0_x64__8wekyb3d8bbwe
Microsoft.SkypeApp                          Microsoft.SkypeApp_12.13.274.0_x64__kzf8qxf38zg5c
Microsoft.WindowsStore                      Microsoft.WindowsStore_11712.1001.13.0_x64__8wekyb3d8bbwe
Microsoft.GetHelp                           Microsoft.GetHelp_10.1706.3471.0_x64__8wekyb3d8bbwe
microsoft.windowscommunicationsapps         microsoft.windowscommunicationsapps_17.8730.21865.0_x64__8wekyb3d8bbwe

Open in new window


Everything I am wanting to remove is still there. Perhaps I am not understanding what is going on here. As I understand, a
remove-appxprovisionedpackage -online -packagename (package_name)

Open in new window

command is supposed to remove apps from the list above. Is this not the case?
0
Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
No, this is something I have misunderstood too.
Get-AppxPackage -AllUsers retrieves all packages which are still "in use" by at least one user profile.
Get-AppxProvisiionedPackage -Online displays the packages still contained in the W10 image.
Both don't need to be related as soon as you made changes to either ;-).
0
Dustin23IT DirectorAuthor Commented:
Creating a new user proved that the Remove-AppxProvisionedPackage -Online -PackageName $_ portion of the script does not work. All the apps that should have been removed are still there. I decided to try this method (first reply, by user Carl Fan), and seems to have worked. The only issue I can see with it (I did not remove ALL the apps, just the ones I tried to remove via the script) is if the XML files are removed, then the apps cannot be reinstalled later.

I am going to mark this as complete and award points for the creation of the script to Qlemo and Sajen Jose, since the script did at least work for removing apps for the current user. Thanks for all the assistance.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.