Created
May 9, 2016 09:48
-
-
Save yskszk63/5c2b692a5d7649776f67a3eef95ce226 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$name = "mytomcat" | |
$service = Get-Service $name | |
$waitsec = New-Timespan -seconds 20 | |
$desktop = "$Env:HOMEDRIVE$Env:HOMEPATH\Desktop" | |
$webapp = "$desktop\tomcat-base\webapps" | |
$war = "$desktop\ROOT.war" | |
if ($service.Status -ne "Stopped") { | |
"Stopping $name..." | |
$service.Stop() | |
$service.WaitForStatus('Stopped', $waitsec) | |
} | |
rm -Recurse -Force $webapp\* | |
cp $war $webapp | |
"Starting $name..." | |
$service.Start() | |
$service.WaitForStatus('Running', $waitsec) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment