Closed Pentadome closed 2 months ago
Code doesn't work
Example 1:
$job = Start-Job -ScriptBlock {Get-Process} Receive-Job -Job $job
In this case Receive-Job returns $null, which is unexpected given the example.
Receive-Job
$null
Example 2:
$job = Start-Job -ScriptBlock {Get-Service dhcp, fakeservice} $job | Receive-Job -Keep Cannot find any service with service name 'fakeservice'. ....
This is incorrect, powershell should not have an output here.
Fixed examples:
$job = Start-Job -ScriptBlock {Get-Process} sleep 1 Receive-Job -Job $job
$job = Start-Job -ScriptBlock {Get-Service dhcp, fakeservice} sleep 1 $job | Receive-Job -Keep Cannot find any service with service name 'fakeservice'. ....
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/receive-job?view=powershell-5.1
https://github.com/MicrosoftDocs/PowerShell-Docs/blob/main/reference/5.1/Microsoft.PowerShell.Core/Receive-Job.md
@sdwheeler
041a02c8-a27e-756f-9a9d-5432bf5a52ac
Type of issue
Code doesn't work
Feedback
Example 1:
In this case
Receive-Job
returns$null
, which is unexpected given the example.Example 2:
This is incorrect, powershell should not have an output here.
Fixed examples:
Example 1:
Example 2:
Page URL
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/receive-job?view=powershell-5.1
Content source URL
https://github.com/MicrosoftDocs/PowerShell-Docs/blob/main/reference/5.1/Microsoft.PowerShell.Core/Receive-Job.md
Author
@sdwheeler
Document Id
041a02c8-a27e-756f-9a9d-5432bf5a52ac