PSResourceGet: [3.0.0-beta10] Install-Module fails with OneDrive - Access to cloud file is denied
PowerShellGet Version: 2.2.5/3.0.0-beta PowerShell: Windows PowerShell 5.1
This issue does not exist with version 2.2.4.1. I’m on a corporate machine so our profile is tied to OneDrive, hence my Documents folder is stored there as well. I’m not sure if this may be related to what was reported on #262 but cannot confirm because policy blocks me from disabling the Files-On-Demand setting for OneDrive.
Repo steps:
- Install PowerShellGet 2.2.5
- Run
Install-Module <any module>
- Receive error
PackageManagement\Install-Package : Access to the cloud file is denied
Attaching the verbose output for reference:
Additional
I have also repeated the repo steps for the 3.0.0-beta and receive the same error but in various scenarios.
If I have 2.2.5 installed as well then the 3.0.0 seems to reference the 2.2.5 version of PSModule file:
[PS 5.1] [22:01:09] [ 82.0ms ] C:\Users\SMelton
[2] > ipmo PowerShelLGet -RequiredVersion 3.0.0
[PS 5.1] [22:01:18] [103.0ms ] C:\Users\SMelton
[3] > Get-Module PowerShelLGet
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 3.0.0 PowerShelLGet {Find-PSResource, Get-PSResource, Get-PSResourceRepository...
[PS 5.1] [22:01:22] [ 25.0ms ] C:\Users\SMelton
[4] > Install-Module Pester -AllowPrerelease -Force
PackageManagement\Install-Package : Access to the cloud file is denied
At C:\Users\SMelton\OneDrive - Thycotic
Corporate\Documents\WindowsPowerShell\Modules\PowerShellGet\2.2.5\PSModule.psm1:9711 char:34
+ ... talledPackages = PackageManagement\Install-Package @PSBoundParameters
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Exce
ption
+ FullyQualifiedErrorId : System.ComponentModel.Win32Exception,Microsoft.PowerShell.Commands.RemoveItemCommand,Mic
rosoft.PowerShell.PackageManagement.Cmdlets.InstallPackage
I delete 2.2.5 completely and then install 3.0.0-beta10, upon import in a new session I get the Access to the cloud file is denied
on the initial import. I issue the import again and it succeeds, but on the call to Install-Module
the error still occurs, this time referencing the 2.2.4.1 PSModule file:
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 9
- Comments: 25 (6 by maintainers)
Issue-Label Bot is automatically applying the label
bug
to this issue, with a confidence of 0.94. Please mark this comment with 👍 or 👎 to give our bot feedback!Links: app homepage, dashboard and code for this bot.
@SteveL-MSFT does that mean this fix will not be pushed down to Windows PowerShell?
@SteveL-MSFT Please provide an update as to when the fix for this will be released as this is preventing me from removing the SharePointPnPPowerShellOnline package to upgrade to the newly PnP.PowerShell.
I see this error in VSCODE. I just followed the recommendation that VSCODE gave me for the PowerShell terminal. (Debugging Node.js)
Is there any ETA on the release of 3.0 or a new beta where this will be resolved?
It is a bit of a pill to have to explain this error for users when they hit problems trying to install modules I’ve published as prerelease. This problem exists all the way back to 2.0.0 release of PowerShellGet (when I gave up testing).
I was able to confirm that 3.0.11-beta was able to successfully uninstall a package where I was having the same ‘Access to the cloud file is denied’ error that is described in this issue. I never had an issue with install-module.
Anyway, using PowershellGet 3.0.11 and the new command Uninstall-PSResource it uninstalled just fine. Now to refactor my scripts for the future.
Hi @crshovrd41 we released 3.0.11-beta this week. Can you try that version and let us know if you’re still encountering the same issue?
Hey @anamnavi - any updates here? Been a month since July 18 and your last update. I’m still seeing the issue as of 5 minutes ago.
this workaround worked for me - adapted from above; this simply adds a leading semi-colon, but appears to resolve it.
$module = “module to install”
$env:PSModulePath = “$([System.IO.Path]::PathSeparator)” + $env:PSModulePath
if (-not (Get-Module -ListAvailable $module)) { Install-Module $module -Scope CurrentUser -Confirm:$false -Force -AllowClobber }
@alerickson I saw your change merged. May I know if the latest release include your changes?