3

I'm trying to install Azure Powershell, following the instructions on this page.

The installation seems to run fine and proceeds without errors.

However, once it's finished, I can't manage to find the Azure Powershell application. I dispose of various terminals

  • Windows Azure Command Prompt
  • Windows Azure Storage Command line

But none of these seems to work. By work, I mean successfully run the first command in the example :

Add-AzureAccount

When I do, it gives me the following error :

'Add-Azure Account' is not recognized as an internal control 
or external, operable program or batch file.

On top of that, I see no mention of azure Powershell in my "All installed softwares" list :

enter image description here

I can run the following commands successfully :

Import-Module MSOnline
Get-Module MSOnline 
    gives me -> Manifest   MSOnline                  {Add-MsolRoleMember, Remove-MsolForeignGroupFromRole, Get-MsolFederation...

However, the following command gives all the same error (ModuleNotFound) :

Import-Module Azure
Import-Module AzureResourceManager
Import-Module AzureProfile

It's quite logical since they don't appear in my module list :

PS C:\Users\matthews> Get-Module -ListAvailable

ModuleType Name                      ExportedCommands
---------- ----                      ----------------
Manifest   AppLocker                 {}
Manifest   BitsTransfer              {}
Manifest   MSOnline                  {}
Manifest   MSOnlineExtended          {}
Manifest   PSDiagnostics             {}
Manifest   PSReadline                {}
Manifest   TroubleshootingPack       {}

To conclude, the solution provided here doesn't work, as there is no PowerShell directory in the Windows Azure folder.

Am I misunderstanding something, or is this a problem caused by the installation ?

NB : I also tried to install it using the standalone installer, but in this case, I get an explicit error message :

This setup requires the Windows PowerShell 3.0 or compatible version to be installed.

I'm having troubles installing the new Powershell version for various reasons, but it may be the solution.

4
  • Try adding -Command "Import-Module MSOnline" as a run argument for PowerShell. Jul 21, 2014 at 8:06
  • @SamuelNicholson I'm now able to run this command, but I'm still facing the same problem.
    – merours
    Jul 23, 2014 at 8:58
  • @fxm - Why don't you just install the Powershell 3.0 and try using the standalone installer of Azure. Note: Windows 7 SP1 is required to install PS 3.0 Jul 24, 2014 at 19:20
  • @Ĭsααctիεβöss Until now, I'm facing the problem described here : superuser.com/questions/541733/cant-install-powershell-3-0/… . The provided solution didn't work, so I'm still searching.
    – merours
    Jul 25, 2014 at 7:00

1 Answer 1

0

The command

Import-Module "C:\Program Files (x86)\Microsoft SDKs\..."

Can work but the path has changed in the time.

You probably just need to reboot, so the $env:PSModulePath will be updated.

BUT if you when a quick fix without the need to reboot you could run this script it will do the trick.

if( (Get-Module -ListAvailable azure | measure).Count -eq 0 )
{
    # == Refresh the Environment variable if just intall the tools without rebooting and try again
    $env:PSModulePath = [System.Environment]::GetEnvironmentVariable("PSModulePath","Machine")

    if( (Get-Module -ListAvailable azure | measure).Count -eq 0 )
    {
        echo("You must install the Azure PowerShell Tools. Go at: http://go.microsoft.com/?linkid=9811175&clcid=0x409")
        Read-Host "Press enter key to close"
        exit
    }
}

echo("Azure PowerShell is installed")

I hope this helps.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .