Get-PartnerInvoice terminates the whole script inside Automation Runbook
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 are there any error details in the job history?
Nope, it just stops execution for no apparent reason... and the command actually returns the invoice just stops all other commands below.