-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInstall-PreReqs.ps1
33 lines (33 loc) · 1.35 KB
/
Install-PreReqs.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
Add-Type -AssemblyName System.Windows.Forms
if (!(Get-Command wt.exe -CommandType Application -ErrorAction SilentlyContinue)) {
$MBResults = & "$PSScriptRoot\OC\Show-CustomDialog.ps1" -Title "Install Terminal?" -PromptText "Windows Terminal is NOT installed. Install Now?" -ButtonsType "YesNo" -IconType "Question"
if ($MBResults -eq [System.Windows.Forms.DialogResult]::Yes) {
winget install Microsoft.WindowsTerminal
}
else {
Write-Host "Not Installing Windows Terminal..."
}
}
else {
Write-Host "WT Already Installed"
}
if (!(Get-Command pwsh.exe -CommandType Application -ErrorAction SilentlyContinue)) {
$MBResults2 = & "$PSScriptRoot\OC\Show-CustomDialog.ps1" -Title "Install PS7?" -PromptText "PS7.4+ is required for this script pack but it not installed...please select ok to install or cancell to quit installation of this script pack!" -ButtonsType "OkCancel" -IconType "Exclamation"
if ($MBResults2 -eq [System.Windows.Forms.DialogResult]::OK) {
winget install Microsoft.PowerShell
}
else {
Write-Host "Aborting Installation!"
break
}
}
else {
Write-Host "PowerShell 7 Already Installed"
}
$scriptroot = $PSScriptRoot
powershell.exe -NoExit -NoProfile -Command {
param (
[string]
$ScriptRootPar
)
powershell.exe -NoExit -File "$ScriptRootPar\Install.ps1"} -Args $scriptroot