azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

Invoke-AzureRmVMRunCommand does not work with ScriptPath and AsJob parameters

Open hyonholee opened this issue 8 years ago • 1 comments

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...

hyonholee avatar Jan 31 '18 19:01 hyonholee

Closing as duplicate of https://github.com/Azure/azure-powershell/issues/5502

maddieclayton avatar Feb 12 '18 08:02 maddieclayton