-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOpsMultitool.ps1
More file actions
55 lines (44 loc) · 1.4 KB
/
OpsMultitool.ps1
File metadata and controls
55 lines (44 loc) · 1.4 KB
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
<#
.SYNOPSIS
Operations Multitool
.DESCRIPTION
A common place to store and run various simple automation tools and scripts originally used
by the Esri Canada GeoFoundation Exchange operations team.
.NOTES
Authored by David Blanchard
Copyright Esri Canada 2023-2026 - All Rights Reserved
#>
# spell-checker: ignore multitool
. $PSScriptRoot\tools\InteractiveMenu.ps1
& {
<#
.SYNOPSIS
Self invoking function which runs the interactive tool.
#>
for (;;) {
# Print header
Clear-Host
Write-Host "------------------------------------"
Write-Host " Ops Multitool "
Write-Host " Copyright Esri Canada 2023-2026 "
Write-Host "------------------------------------"
Write-Host ""
# Assemble list of tools
$options = [ordered]@{}
Get-ChildItem $PSScriptRoot\tools -Filter *.ps1 |
Foreach-Object {
if ($_.BaseName -ne "InteractiveMenu") {
$options.Add($_.FullName, $_.BaseName.Replace("_", " "))
}
}
# Request selection then execute tool or quit
$selected = InteractiveMenuWithQuit "What tool do you want to run?" $options
Clear-Host
if ($null -eq $selected) {
break
}
& $selected
Write-Host ""
Read-Host -Prompt "Press enter to return to main menu"
}
}