Invoke-AzureRmVMRunCommand does not work with ScriptPath and AsJob parameters
Cmdlet(s)
Invoke-AzureRmVMRunCommand
PowerShell Version
Instructions: to get PowerShell version, type $PSVersionTable and look for the value associated with PSVersion
Module Version
OS Version
Instructions: to get OS version, type $PSversionTable and look for value associated with BuildVersion
Description
Invoke-AzureRmVmRunCommand failed with ScriptPath and AsJob parameters.
Debug Output
Instructions: to get Debug Output, set $DebugPreference="Continue" and then execute the cmdlet or script causing the issue
Script/Steps for Reproduction
PS C:> $job = Invoke-AzureRmVmRunCommand -ResourceGroupName $rgname -VMName $vmname -CommandID "RunPowerShellScript" -ScriptPath $scriptpath -AsJob
PS C:> $job
Id Name PSJobTypeName State HasMoreData Location Command
1 Long Running... AzureLongRun... Failed True localhost Invoke-AzureRmVMRunCom...
Closing as duplicate of https://github.com/Azure/azure-powershell/issues/5502