Skip to content

Uninstall-Module fails when OneDrive has "Files-On-Demand" feature enabled #262

@daniefer

Description

@daniefer

I am forced to disable this File-On-Demand feature in OneDrive in order to get this error to go away. This is a real inconvenience for those on an enterprise environment where users who don't have rights to run as administrator cannot install modules under any other scope other than CurrentUser and don't have the access to modify Policies that allow disabling of the File-On-Demand feature (which requires a registry edit).

Steps to Reproduce

  1. Install any module under the CurrentUser Scope
  2. Uninstall that module

Actual Results

Uninstall-Package : Access to the cloud file is denied
At line:1 char:1
+ Uninstall-Package Thor
+ ~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Microsoft.Power...ninstallPackage:UninstallPackage) [Uninstall-Package],
   Exception
    + FullyQualifiedErrorId : System.ComponentModel.Win32Exception,Microsoft.PowerShell.Commands.RemoveItemCommand,Mic
   rosoft.PowerShell.PackageManagement.Cmdlets.UninstallPackage

Expected Results

The module should uninstall successfully.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions