Commit 20bb12e9 authored by Volker Hilsheimer's avatar Volker Hilsheimer
Browse files

Improvements to Windows basebox provisioning scripts

parent 92ee9360
......@@ -12,5 +12,7 @@ Set-Service ssh-agent -StartupType Automatic
Start-Service sshd
Start-Service ssh-agent
mkdir $env:userprofile\.ssh
curl -o $env:userprofile\.ssh\authorized_keys https://raw.githubusercontent.com/hashicorp/vagrant/master/keys/vagrant.pub
# put the public insecure vagrant key into C:\ProgramData\ssh\administrators_authorized_keys
icacls.exe "C:\ProgramData\ssh\administrators_authorized_keys" /inheritance:r /grant "Administrators:F" /grant "SYSTEM:F"
# icacls.exe "C:\ProgramData\ssh\administrators_authorized_keys" /inheritance:r /grant "Administrators:F" /grant "SYSTEM:F"
$package = "PowerShell-7.1.1-win-x64.msi"
$version = "7.2.1"
$package = "PowerShell-${version}-win-x64.msi"
if (! (Test-Path "C:\Program Files\PowerShell\7")) {
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
(new-object net.webclient).DownloadFile(
"https://github.com/PowerShell/PowerShell/releases/download/v7.1.1/${package}",
"${package}")
curl -o ${package} "https://github.com/PowerShell/PowerShell/releases/download/v${version}/${package}"
& .\${package} /quiet ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1 ENABLE_PSREMOTING=1 REGISTER_MANIFEST=1
Write-Host "Waiting for installation of PowerShell 7.1.1"
Write-Host "Waiting for installation of PowerShell ${version}"
while (! (Test-Path "C:\Program Files\PowerShell\7")) {
Write-Host "."
Start-Sleep -Seconds 5
}
Remove-Item "PowerShell-7.1.1-win-x64.msi"
Remove-Item $package
}
......@@ -46,7 +46,7 @@ if (!(Test-Path $ChocoInstallPath)) {
cd $ChocoInstallPath
$packages = ( "pstools" )
$packages = ( "pstools", "sdelete" )
.\chocolatey feature enable -n=allowGlobalConfirmation
ForEach ( $p in $packages ) { .\choco install --no-progress -y $p }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment