2

I tried searching for same on net but was not able to find anything useful. I went through this and this link but they both talk about only PowerShell and not Azure PowerShell.

I still tried it and got following error

C:\Windows\SysWOW64\WindowsPowerShell\v1.0>powershell.exe Get-AzureVM Get-AzureVM : The term 'Get-AzureVM' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + Get-AzureVM + ~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Get-AzureVM:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException

Any help would be appreciated. Thank you in advance.

Community
  • 1
  • 1
C Deepak
  • 1,258
  • 1
  • 17
  • 23

2 Answers2

3

That's because the module for Windows Azure wasn't loaded. Try creating a script file (vm.ps1) with the following:

Import-Module "C:\Program Files (x86)\Microsoft SDKs\Windows Azure\PowerShell\Azure\Azure.psd1"
Get-AzureVM

And then run it like this (assuming you saved it on your C: drive):

powershell.exe C:\vm.ps1 
Sandrino Di Mattia
  • 24,739
  • 2
  • 60
  • 65
  • Hi Sandrino. Thanks you for pointing that out. It is working properly now. Just need to find a way to execute it using Java now. – C Deepak Jan 23 '14 at 12:43
-1

If your ultimate goal is to manage/automate Azure resources by using Java code or to build Java apps with Azure services, you may wish to review the Microsoft Azure SDK for Java.

Nathan Tuggy
  • 2,237
  • 27
  • 30
  • 38