Partner-Center-PowerShell icon indicating copy to clipboard operation
Partner-Center-PowerShell copied to clipboard

Get-PartnerInvoice terminates the whole script inside Automation Runbook

Open cblackuk opened this issue 5 years ago • 2 comments

Steps to reproduce

Run Get-PartnerInvoice inside an Automation Runbook

Get-PartnerInvoice 
Write-Output -InputObject "Should continue"

Returns:

Account            : Microsoft.Store.PartnerCenter.PowerShell.Models.Authentication.PartnerAccount
CountryCode        : GB
Environment        : Microsoft.Store.PartnerCenter.PowerShell.Models.Authentication.PartnerEnvironment
ExtendedProperties : {}
Locale             : en-GB
XXXXXXX

But if you run it with Invoke-Command it works:

Invoke-Command -ScriptBlock { Get-PartnerInvoice }
Write-Output -InputObject "Should continue"

Returns:

Account            : Microsoft.Store.PartnerCenter.PowerShell.Models.Authentication.PartnerAccount
CountryCode        : GB
Environment        : Microsoft.Store.PartnerCenter.PowerShell.Models.Authentication.PartnerEnvironment
ExtendedProperties : {}
Locale             : en-GB
XXXXXX
Should continue...

I tested it on old modules, and the latest ones - it is broken on all of them. It works inside a docker container, or local PS Session, but not in an Automation Runbook.

Can this be looked at please? I cannot think of a reason why would that be just preventing any other code to execute when the command is run. @isaiahwilliams Can we somehow get to the bottom of this please? I am worried that other bits will be similarly affected.

cblackuk avatar Feb 07 '20 13:02 cblackuk

@cblackuk are there any error details in the job history?

ghost avatar Mar 03 '20 21:03 ghost

Nope, it just stops execution for no apparent reason... and the command actually returns the invoice just stops all other commands below.

cblackuk avatar Mar 04 '20 05:03 cblackuk