Closed grossgrundbesitzer closed 1 year ago
In the comments for "Uninstall-Private teams" the context "Admin" is documented, which is wrong.
The problem is, that the following line is executed in a user context: Get-AppxPackage -Name MicrosoftTeams | Remove-AppxPackage -ErrorAction stop
Get-AppxPackage -Name MicrosoftTeams | Remove-AppxPackage -ErrorAction stop
Microsoft documentation for Get-AppxPackage:
Gets a list of the app packages that are installed in a user profile.
The script would work if executed in the user context. But you could also rewrite it, and add the flag "-allusers", to Get-AppxPackage so that you can run the script as admin. More Information: https://learn.microsoft.com/en-us/powershell/module/appx/get-appxpackage?view=windowsserver2022-ps
Good spot, added -allusers
In the comments for "Uninstall-Private teams" the context "Admin" is documented, which is wrong.
The problem is, that the following line is executed in a user context:
Get-AppxPackage -Name MicrosoftTeams | Remove-AppxPackage -ErrorAction stop
Microsoft documentation for Get-AppxPackage:
The script would work if executed in the user context. But you could also rewrite it, and add the flag "-allusers", to Get-AppxPackage so that you can run the script as admin. More Information: https://learn.microsoft.com/en-us/powershell/module/appx/get-appxpackage?view=windowsserver2022-ps