Don't print skipping in bootstrap-Windows.ps1

This commit is contained in:
Kenneth Benzie 2024-08-09 17:41:23 +01:00
parent 379c081144
commit 20cf3617bc

View File

@ -31,24 +31,18 @@ if (-Not $IsElevated) {
Invoke-WebRequest -Uri "https://downloads.1password.com/win/1PasswordSetup-latest.exe" -OutFile "$1passwordInstaller" Invoke-WebRequest -Uri "https://downloads.1password.com/win/1PasswordSetup-latest.exe" -OutFile "$1passwordInstaller"
&$1passwordInstaller &$1passwordInstaller
Remove-Item $1passwordInstaller Remove-Item $1passwordInstaller
} else {
echo 'Skipping 1Password'
} }
# Enable Hyper-V # Enable Hyper-V
$Decision = $Host.UI.PromptForChoice('Enable Hyper-V', 'Proceed?', $Choices, 0) $Decision = $Host.UI.PromptForChoice('Enable Hyper-V', 'Proceed?', $Choices, 0)
if ($Decision -eq 0) { if ($Decision -eq 0) {
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
} else {
echo 'Skipping Hyper-V'
} }
# Enable Containters # Enable Containters
$Decision = $Host.UI.PromptForChoice('Enable Containers', 'Proceed?', $Choices, 0) $Decision = $Host.UI.PromptForChoice('Enable Containers', 'Proceed?', $Choices, 0)
if ($Decision -eq 0) { if ($Decision -eq 0) {
Enable-WindowsOptionalFeature -Online -FeatureName Containers -All Enable-WindowsOptionalFeature -Online -FeatureName Containers -All
} else {
echo 'Skipping Containers'
} }
# Install Chocolatey # Install Chocolatey
@ -61,8 +55,6 @@ if (-Not $IsElevated) {
choco install --yes "--package-parameters=/SSHServerFeature" openssh choco install --yes "--package-parameters=/SSHServerFeature" openssh
Start-Service sshd Start-Service sshd
Set-Service -Name sshd -StartupType 'Automatic' Set-Service -Name sshd -StartupType 'Automatic'
} else {
echo 'Skipping SSH Server'
} }
Write-Host 'Press any key to continue...' Write-Host 'Press any key to continue...'