-
Notifications
You must be signed in to change notification settings - Fork 86
Description
Do you want to request a feature or report a bug?
Bug. Need the -force parameter to kill or delete or remove a hung job. Or any other parameter of combination of parameters and commands that will do the same.
What is the current behavior?
RsJob hangs and cannot be killed/removed even with -Force. Its been quite frequent. I am testing with 10 threads at a time and a total of 20 accounts to be processed. Since Morning I have encountered one job hanging in 3 different attempts.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
Please see attached screenshots
What is the expected behavior?
Hangs and cannot be killed
Which versions of Powershell and which OS are affected by this issue? Did this work in previous versions of our scripts?
Powershell Version = 5.1.14393.3866
Windows server 2016, OS Build 14393
Please provide a code example showing the issue, if applicable:
Instaed of the full code, I have provided just the relevant lines.
$ScriptLocal =
{
param(
$Alias,
$Cred_Cloud
)
Connect-ExchangeOnline -Credential $Cred_Cloud | Out-Null
Get-MailboxStatistics $Alias
Get-PSSession | Remove-PSSession
}
Start-RsJob -Name "job_$Alias" -ScriptBlock $ScriptLocal -ArgumentList $Alias, $Cred_Cloud
$Job | receive-rsjob | select DisplayName, LastUserActionTime
