forked from Sitefinity/feather
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCleanup.ps1
More file actions
25 lines (22 loc) · 810 Bytes
/
Cleanup.ps1
File metadata and controls
25 lines (22 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Import-Module WebAdministration
$currentPath = Split-Path $script:MyInvocation.MyCommand.Path
$variables = Join-Path $currentPath "\Variables.ps1"
. $variables
. $functionsModule
write-output "Restarting TestAgent process..."
try{
$testAgentProcess = Get-Process QTAgentProcessUI
$testAgentProcess.Kill()
$testAgentProcess.WaitForExit()
}catch [Exception]{
}finally{
write-output "Cleaning test agent temp folders..."
Start-Sleep -s 5
CleanDirectory $agentTempFolder
Start-Process -FilePath $testAgentExe
Remove-Item $aspNetTempFolder -Force -Recurse -ErrorAction Continue
write-output "TestAgent process started."
}
write-output "Restarting WebApp pools..."
Restart-WebAppPool $appPollName -ErrorAction Continue
Restart-WebAppPool $secondAppPollName -ErrorAction Continue