-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.ps1
42 lines (35 loc) · 1.07 KB
/
Main.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
# Main.ps1
. .\Scripts\OutputHandler.ps1
# User picks: GUI or Console
$interfaceMode = Show-InputPromptMessage "Enter **C** for Console Interface or **G** for GUI Interface"
if ($interfaceMode -eq 'C') {
# Console Interface
# Dot-source to InputHandler and Calculator
. .\Scripts\InputHandler.ps1
. .\Scripts\Calculator.ps1
$inputType, $value = Get-UserInput
# Calculate wages and taxes
$results = Get-CalculateWagesAndTaxes -inputType $inputType -value $value
Show-OutputFormattedMessage "**RESULTS**"
# Output the results
foreach ($KeyValuePair in $results.GetEnumerator()) {
$prompt = $KeyValuePair.Name
$output = $KeyValuePair.Value
Show-OutputMessage $prompt $output
}
}
elseif ($interfaceMode -eq 'G') {
# GUI Interface
# Run GUI script
if ($IsWindows) {
. .\GUI\GUI.ps1
} else {
Show-ErrorMessage "Only Microsoft Windows is supported for GUI mode"
}
}
else {
Show-ErrorMessage "Invalid input. Please enter 'C' for Console or 'G' for GUI."
}
<#
you should do this here
#>