Terminate PowerShell process after script executing
I have a TFS Build where I run PowerShell script. The problem is PowerShell.exe never stops after runnig and do nothing. Script is signed by trusted sertificate and successfully runs on my BuildAgent from PowerShell and writes logs. But it don't to anything from bu开发者_Go百科ild or from cmd.exe. PowerShell.exe just starts and do nothing.
P.S. PS script have Exit commands but it not help.
Thanks, Roman
You can use, Stop-Process -Id $PID
from within the script to end the current PowerShell process.
The issue was resolved. Problem was security settings on BuildAgent. When I run script manually from BuildAgent user's account and choose "Run always" build starts working correctly.
精彩评论