I've been using this command in my script
$jira = Get-JiraIssue -Query $jiraQuery -Credential $jiraCred | Select-Object Assignee,customfield
Which results in an array as such:
Assignee customfield
---- ----
Unassigned D00525FFKSAN0
first.last 1FLSALF05
However, if I run the same command in Start-Job scriptblock:
Start-Job -Name Jira -ScriptBlock {param($jiraQuery,$jiraCred) Get-JiraIssue -Query $jiraQuery -Credential $jiraCred | Select-Object Assignee,customfield} -ArgumentList $jiraQuery, $jiraCred
Receive-Job -Name JIra -Keep
The results end up being like:
Assignee : Unassigned
customfield : ASLFDSGLDMF06
RunspaceId : a670925b-537a-4d54-adce-89c693f3fa9d
--------
Assignee : @{TimeZone=America/Los_Angeles; Key=JIRAUSER0000; AvatarUrl=; Groups=; Active=True; AccountId=; DisplayName=First Last; EmailAddress=first.last@jira.com; Locale=; RestUrl=https://jira.com/rest/api/2/user?username=first.last; Name=first.last}
customfield : ASLFDSGLDMF05
RunspaceId : a670925b-537a-4d54-adce-89c693f3fa10d
I've tried using -ExpandProperty on the job results, but then the Assignee property takes over and results in:
Name DisplayName Active
---- ----------- ------
first.last First Last Yes
first.last2 First Last 2 Yes
first.last3 First Last 3 Yes
What's happening here? I can't seem to figure out how to get the same results I'm getting by running the command directly, outside of Start-Job