-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHelp-section.ps1
68 lines (57 loc) · 1.63 KB
/
Help-section.ps1
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Set parameters
param (
[switch]$extpurge,
[string]$cleandump,
[switch]$help
)
# Usage statement
$helpContent = @"
Usage: .\help-section.ps1 [options]
Options:
-help Display this help message
-extpurge Roll the service for <Service Name>
-cleandump <value> Clean up the spurious dump files on one of three servers
Examples:
.\help-section.ps1 -help
.\help-section.ps1 -extpurge
.\help-section.ps1 -cleandump <servername>
.\help-section.ps1 -extpurge -cleandump <servername>
Description:
This is a script which is designed to be a one stop shop for easily remedied issues.
The first is an <servicename> service roll. The second is a clean up of dump files for disk
space issues. Other tasks can be added.
"@
# Function to roll the external purge service running on 10306
function ext-purge-roll {
$Server = "Some-server"
$Service = "<servicename>"
$marker = 1
if ($marker -eq 1) {
Write-Host "Parameters Set for <Service Name> Service Roll"
Write-Host "Server:" $Server
Write-Host "Service:" $Service
}
}
# Function to remove designated dump files on one of three hosts
function cleandump {
param (
[string]$Server
)
$marker = 1
if ($marker -eq 1) {
Write-Host "Parameter Set for Dump File Clean Up task"
Write-Host "Server:" $Server
}
}
# Check if any arguments are passed and print usage statement if not
if ($help) {
Write-Output $helpContent
exit
}
# Call Functions
if ($extpurge) {
ext-purge-roll
}
if ($cleandump) {
cleandump -Server $cleandump
}