question

JonathanYe-9906 avatar image
3 Votes"
JonathanYe-9906 asked EnterpriseArchitect commented

Access to the cloud file is denied when install az powershell

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
az-powershell.png (15.3 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AndreasBaumgarten avatar image
0 Votes"
AndreasBaumgarten answered JonathanYe-9906 commented

Hi @JonathanYe-9906 ,

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



· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi Andreas,

After setting the TLS to 1.2 does not work for me or am I setting the TLS in the wrong way? Is there a way to verify that TLS has been set to 1.2?

Best,
Jonathan80779-az1.png


0 Votes 0 ·
az1.png (19.6 KiB)
IanXue-MSFT avatar image
1 Vote"
IanXue-MSFT answered EnterpriseArchitect commented

Hi,

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

https://docs.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.

· 6
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi Ian,

I followed the link and updated the Powershellget to latest version(2.2.5) and the error is still there. Is this the latest powershellget version?

Best,
Jonathan

0 Votes 0 ·

I downloaded 3.0.0-beta10 but when I try to run the command it's still running with 2.2.5. Is there a way that I can force the script run with the prerelease powershellget?

0 Votes 0 ·
Show more comments

Hi @IanXue-MSFT,

When we are using the OneDrive folder redirection C:\Users\User.Name\OneDrive - CompanyName\Documents\WindowsPowerShell\Modules shall we start to use the .MSI version ?

0 Votes 0 ·
LeighAndrews-2501 avatar image
2 Votes"
LeighAndrews-2501 answered

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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.