Quantcast
Channel: Azure Virtual Machines forum
Viewing all articles
Browse latest Browse all 12545

Error when testing powershell script on azure automation runbook (Error : input object cannot be bound to any parameters...)

$
0
0

Hello, 

I am getting error while running powershell script in windows azure automation runbook.

This is my script that raised the error

$subName = "My Subscription Name" $serviceName = "MyServiceName" $vmName = "MyVMName" Connect-Azure -AzureConnectionName $subName Select-AzureSubscription -SubscriptionName $subName $vm = Get-AzureVM -ServiceName $serviceName -Name $vmName $vm

#Error occur after executing this line "Get-AzureOSDisk" $vmOSDisk = $vm | Get-AzureOSDisk $vmOSDisk

Full error message is 

==========

7/31/2014 4:04:16 PM, Error: Get-AzureOSDisk : The input object cannot be bound to any parameters for the command either because the command does 
not take pipeline input or the input and its properties do not match any of the parameters that take pipeline input.
At Stop-MyDemo:67 char:67

    + CategoryInfo          : InvalidArgument: (Microsoft.Windo...ntVMRoleContext:PSObject) [Get-AzureOSDisk], 
ParameterBindingException
    + FullyQualifiedErrorId : 
InputObjectNotBound,Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS.PersistentVMs.GetAzureOSDiskCommand
 ==========

I can call that "$vm | Get-AzureOSDisk" on my local computer using Windows Azure Powershell. Is there any syntax difference withing windows azure powershell and the script that used by Windows Azure Automation Runbook?

Azure module was imported (that I found under ASSETS).

Please advise, 

Thanks


Viewing all articles
Browse latest Browse all 12545

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>