I can’t seem to find a reason, so I hope you can shine a light.
Following code doesn’t execute the second write-progress.
The output for get-webapplication is shown in my receive-job, so the command executes correctly.
I can execute other commands after the get-webapplication and they work fine as well.
But not write-progress
If I change the get-webapplication to get-process, then everything works ok.
Why does get-webapplication block every subsequent write-progress?
As info:
PSVersionTable for my webserver
Name Value
PSVersion 5.1.14393.3866
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.3866
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
cls
$Computer = "SomeWebserver"
function Dummy{
Import-Module webadministration
Write-Progress -PercentComplete 10 -Activity "Dummy" -CurrentOperation "testing"
Get-WebApplication
#Get-Process
Write-Progress -PercentComplete 20 -Activity "Dummy" -CurrentOperation "testing2"
}
$job = invoke-command -asjob -ComputerName $Computer -ScriptBlock ${Function:Dummy}
$job | Wait-Job | Receive-Job
$job.ChildJobs[0].progress