How to install Az module on Windows Server through DevOps

0 votes

 I have to execute the PS script on one of the APIs in my .Net Core application. Previously I used AzureRm commands in my PS script with the .Net framework. But after upgrading to .Net Core this script stopped working. Then I updated the PS script to use Az commands then it gave me an error :

"The specified module 'Az' was not loaded because no valid module file was found in any module directory."

DevOps Powershell Script to install Az module:

Install-Module -Name Az -RequiredVersion 2.8.0 -Force -AllowClobber 

Get-InstalledModule #Just print out the details to confirm whether `Az 2.8.0` has been installed successfully

// Even setting PSModulePath is not working

$key = (Get-Item 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager').OpenSubKey('Environment', $true)

$path = $key.GetValue('PSModulePath','','DoNotExpandEnvironmentNames')

$path += ';D:\Program Files (x86)\ManagedDependencies\PowerShell\AzPSModules\1.0.0'

$key.SetValue('PSModulePath',$path,[Microsoft.Win32.RegistryValueKind]::ExpandString)

What should I do to execute the Az command in the PS script?

Apr 14 in Other DevOps Questions by Kichu
• 16,850 points
17 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Other DevOps Questions

0 votes
0 answers
0 votes
0 answers
0 votes
1 answer

How do I install Maven on Windows?

Hey @Laksha, to install Apache Maven all ...READ MORE

answered Feb 19, 2019 in Other DevOps Questions by Kashish
277 views
0 votes
1 answer
0 votes
1 answer

powerbi embeded in .net core 1.1

See if it helps: https://www.nuget.org/packages/PowerBI.NetStandar ...READ MORE

answered Nov 28, 2018 in Power BI by Upasana
• 8,620 points
577 views
0 votes
1 answer

Power BI Embedded : Importing Packages

This should help you out. https://www.nuget.org/packages/PowerBI.N ...READ MORE

answered Apr 3, 2019 in Power BI by Shubham
• 13,490 points
168 views
0 votes
0 answers
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP