Access to the cloud file is denied when install az powershell

Jonathan Ye 16 Reputation points
2021-03-23T19:45:21.423+00:00

I tried to install az powershell with the command Install-Module -Name Az -AllowClobber -Scope CurrentUser -SkipPublisherCheck -Force And the process failed with error message "PackageManagement\Install-Package : Access to the cloud file is denied ". I didn't see a pop up ask me sign in and I'm pretty sure my credential is still valid. The error message 80788-az-powershell.pngis hard to understand. Can someone help take a look at it? Any ideas are appreciated. Error screenshot is attached.

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,549 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Leigh Andrews 21 Reputation points
    2021-09-20T18:59:29.273+00:00

    I had similar problems with AzureADPreview and uninstalling AzureAD when the store location is OneDrive.

    Use Get-Module -ListAvailable to see the location of the modules.

    Perform the following and replace the AzureADPreview with the module your trying to install:

    Set-ExecutionPolicy -ExecutionPolicy Unrestricted
    Install-Module AzureADPreview -Repository PSGallery -AllowClobber
    Import-Module AzureADPreview
    Get-Module

    Your module should have loaded, and it seems the execution policy is causing the issues.

    Install-Module -Name powershellget -force -AllowPrerelease -Verbose -Repository PSGallery -AllowClobber
    Import-Module PowerShellGet -Verbose

    PowerShellGet 3.0.11-beta is supposed to fix the uninstall module but that doesn't seem to work.
    I find deleting the folders from the store is the only way at the moment when the modules are in the OneDrive folder.

    4 people found this answer helpful.

  2. Ian Xue 37,541 Reputation points Microsoft Vendor
    2021-03-24T03:18:18.09+00:00

    Hi,

    Can you try updating the Powershellget to the latest version? You can refer to this link for details

    https://learn.microsoft.com/en-us/powershell/scripting/gallery/installing-psget

    Best Regards,
    Ian Xue

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

  3. Andreas Baumgarten 111.1K Reputation points MVP
    2021-03-23T21:20:40.87+00:00

    Hi @Jonathan Ye ,

    could yo please try to set the Transport Layer Security (TLS) version to 1.2 on your computer.

    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12   
    

    Hope this helps.

    ----------

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.