bootstrap/bootstrap-Windows.ps1
Kenneth Benzie (Benie) c3abae0aa9 Update bootstrap-Windows.ps1 script
* Add 1Password install step
* Remove SSH key generation step
* Remove SSH server step
* Make 1Password, Hyper-V and Containers steps optional
2024-08-09 11:29:38 +01:00

37 lines
1.2 KiB
PowerShell

$choices = '&Yes', '&No'
# Install 1Password
$decision = $Host.UI.PromptForChoice('Install 1Password', 'Proceed?', $choices, 0)
if ($decision -eq 0) {
$1password_installer = "$env:USERPROFILE/Downloads/1PasswordSetup-latest.exe"
Invoke-WebRequest -Uri "https://downloads.1password.com/win/1PasswordSetup-latest.exe" -OutFile "$1password_installer"
&$1password_installer
Remove-Item $1password_installer
} else {
echo 'Skipping 1Password'
}
# Enable Hyper-V
$decision = $Host.UI.PromptForChoice('Enable Hyper-V', 'Proceed?', $choices, 0)
if ($decision -eq 0) {
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
} else {
echo 'Skipping Hyper-V'
}
# Enable Containters
$decision = $Host.UI.PromptForChoice('Enable Containers', 'Proceed?', $choices, 0)
if ($decision -eq 0) {
Enable-WindowsOptionalFeature -Online -FeatureName Containers -All
} else {
echo 'Skipping Containers'
}
# Install Chocolatey
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
# # Install OpenSSH and start service
# choco install --yes "--package-parameters=/SSHServerFeature" openssh
# Start-Service sshd
# Set-Service -Name sshd -StartupType 'Automatic'