0

I have been testing code on my laptop recently, and this appears to be broken my az cli setup. I now get an error, I have followed the steps detailed on most SO pages which entail running the command

Invoke-WebRequest -Uri https://aka.ms/installazurecliwindows -OutFile .\AzureCLI.msi; Start-Process msiexec.exe -Wait -ArgumentList '/I AzureCLI.msi /quiet'; rm .\AzureCLI.msi

AZ cli works on command prompt just not on powershell.

  • I uninstalled az cli
  • Restarted laptop
  • Ran the command above which completed, again it works on command prompt just not on powershell.

Environment.

Windows 10 Ps version

Major Minor Build Revision


5 1 19041 1682

I suspect it is to do with the path profiles as the script I was running the other day was changing the path profile before I had to reboot the laptop.

I also found this instruction on another SO page. ran this to no avail.

Install-Module AzureAD -Force Install-module AzureADPreview -Force Install-Module -Name MSOnline -Force Import-Module Az -Force Install-Module Az -Force
learner
  • 545
  • 2
  • 9
  • 23

1 Answers1

0

Thanks @mklement0, you definitely pointed me in the right direction.

I ran $env:path and this came up with C:\Program Files\OpenSSL\bin I can see the problem now, I resolved it by getting the values of my path variable from the GUI Advanced system settings >> Environment variables and copy the values of path.

from a PS console screen set the values for path by running the following.

$env:path = "the values from the path environment variables above"

After running the above, I can run az cli once more.

learner
  • 545
  • 2
  • 9
  • 23