Created
August 15, 2016 20:31
-
-
Save rogfut/f2804ad8dcc80df2a36314105792137a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function Install-Tomcat { | |
[CmdletBinding()] | |
param( | |
# Path to the Tomcat installer exe | |
[Parameter(Mandatory=$true)] | |
[string] | |
$Path, | |
# Install Destination | |
[Parameter(Mandatory=$true)] | |
[ParameterType] | |
$Destination, | |
# Service name that the Tomcat service will run as | |
[Parameter(Mandatory=$false)] | |
[ValidatePattern("(?i)Tomcat")] | |
[string] | |
$ServiceName = "Tomcat7", | |
# Path to java install | |
[Parameter(Mandatory=$false)] | |
[string] | |
$javapath = $env:java_home, | |
# Java Options | |
[Parameter(Mandatory=$false)] | |
[string[]] | |
$javaopts, | |
# When used will update Tomcat instead of doing a clean install | |
[Parameter(Mandatory=$false)] | |
[switch] | |
$Update | |
) | |
begin { | |
#some basic code goes here to test paths, verify params, verifies catalina.jar version | |
function Get-TomcatStatus { | |
#checks to see if tomcat already exists at $destination, also checks to see if there is a service with a name like Tomcat already | |
#returns $TomcatStatus | |
} | |
function New-Install { | |
#some code goes here to do a fresh install after determining the state of Tomcat on the host | |
} | |
function Upgrade-Tomcat { | |
#if the switch -Update is used, it will run a command to update the tomcat options | |
} | |
} | |
process { | |
If(!($Update)) { | |
New-Install $path $destination $servicename $javaopts | |
} else { | |
Update-Install $path $destination $servicename $javaopts | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment