Skatterbrainz / psIntune

PowerShell functions for Intune management operations
MIT License
6 stars 2 forks source link

Cannot unistall #8

Open bezik46 opened 1 year ago

bezik46 commented 1 year ago
PS C:\WINDOWS\system32> uninstall-Module psIntune
PackageManagement\Uninstall-Package : Access to the cloud file is denied
At C:\Program Files (x86)\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:2194 char:21
+ ...        $null = PackageManagement\Uninstall-Package @PSBoundParameters
+                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Microsoft.Power...ninstallPackage:UninstallPackage) [Uninstall-Package],
   Exception
    + FullyQualifiedErrorId : System.ComponentModel.Win32Exception,Microsoft.PowerShell.Commands.RemoveItemCommand,Mic
   rosoft.PowerShell.PackageManagement.Cmdlets.UninstallPackage
bezik46 commented 1 year ago

Because by default it installs to OneDrive redirected Documents, the uninstall does not work, so only option is to delete by hand as per ie this: https://learn.microsoft.com/en-us/answers/questions/328264/access-to-the-cloud-file-is-denied-when-install-az.html

Skatterbrainz commented 1 year ago

Unfortunately, that's a side effect of KFM (known folder move) settings in OneDrive. I would recommend installing modules as Scope Machine/All users, rather than CurrentUser.