Start-ADTProcess not timing out - set to 150 minutes
I am running a powershell script inside a Start-ADTProcess and I've set the timeout for 150 minutes, but it carried on for 264 minutes.
$result = $null
$StartTime = Get-Date
$result = Start-ADTProcess -FilePath "$PSHOME\powershell.exe" `
-ArgumentList "-file `"C:\test.ps1`"" `
-Timeout ([TimeSpan]::FromMinutes(150)) `
-TimeoutAction SilentlyContinue `
-NoTerminateOnTimeout `
-IgnoreExitCodes '*' `
-CreateNoWindow `
-PassThru
if ($null -eq $result) {
Write-ADTLogEntry -Message "test still running after 150 minutes, moving on."
} else {
$Duration = (Get-Date) - $StartTime
Write-ADTLogEntry -Message "test completed with exit code: $($result.ExitCode) | Duration: $([math]::Round($Duration.TotalMinutes, 1)) minutes."
if ($result.StdOut) {
Write-ADTLogEntry -Message "test output:`n$($result.StdOut)"
}
}
In the log file it stays the following
[Install] :: test completed with exit code: 0 | Duration: 264 minutes.
Screenshot of the time it started and the time it finished:
image.png (265×63)
Any ideas what's gone wrong? Is it the switches in the Start-ADTProcess?
Posted Jul 13, 2026, 4:36 PM UTC
21