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.

有帮助吗?

解决方案

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 

其他提示

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top