|
Write-Host -foregroundcolor green 'Disable UAC' |
|
Set-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows\CurrentVersion\policies\system' -Name EnableLUA -Value 0 |
|
|
|
Write-Host -foregroundcolor green 'Disable Auto Updates' |
|
$au = (new-object -com Microsoft.Update.AutoUpdate).Settings |
|
$au.NotificationLevel = 1 |
|
$au.Save() |
|
$au.Refresh() |
|
|
|
Write-Host -foregroundcolor green 'Configuring Windows Remote Management' |
|
winrm quickconfig -q |
|
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="512"}' |
|
winrm set winrm/config '@{MaxTimeoutms="1800000"}' |
|
winrm set winrm/config/service '@{AllowUnencrypted="true"}' |
|
winrm set winrm/config/service/auth '@{Basic="true"}' |
|
sc.exe config WinRM start= auto |
|
|
|
Write-Host -foregroundcolor green 'Installing OpenSSH Server' |
|
(new-object System.Net.WebClient).DownloadFile('https://github.com/PowerShell/Win32-OpenSSH/releases/download/v7.7.1.0p1-Beta/OpenSSH-Win64.zip', 'C:\OpenSSH-Win64.zip') |
|
$shell = new-object -com shell.application |
|
$shell.NameSpace('C:\Program Files').CopyHere($shell.NameSpace('C:\OpenSSH-Win64.zip').Items(), 0x614) |
|
& 'C:\Program Files\OpenSSH-Win64\install-sshd.ps1' |
|
netsh advfirewall firewall add rule name=sshd dir=in action=allow protocol=TCP localport=22 |
|
net start sshd |
|
Set-Service sshd -StartupType Automatic |
|
md -Force C:\Users\vagrant\.ssh |
|
(new-object System.Net.WebClient).DownloadFile('https://github.com/hashicorp/vagrant/raw/64acd68c64e997492137425b0844e477391a6788/keys/vagrant.pub', 'C:\Users\vagrant\.ssh\authorized_keys') |
|
del 'C:\OpenSSH-Win64.zip' |
|
|
|
Write-Host -foregroundcolor green 'Installing Digital Mars C Compiler' |
|
(new-object System.Net.WebClient).DownloadFile('http://ftp.digitalmars.com/Digital_Mars_C++/Patch/dm857c.zip', 'C:\dmc.zip') |
|
$shell = new-object -com shell.application |
|
$shell.NameSpace('C:\').CopyHere($shell.NameSpace('C:\dmc.zip').Items(), 0x614) |
|
del 'C:\dmc.zip' |
|
|
|
Write-Host -foregroundcolor green 'Updating Digital Mars OPTLINK' |
|
(new-object System.Net.WebClient).DownloadFile('http://ftp.digitalmars.com/optlink.zip', 'C:\optlink.zip') |
|
$shell = new-object -com shell.application |
|
$shell.NameSpace('C:\dm\bin').CopyHere($shell.NameSpace('C:\optlink.zip').Items(), 0x614) |
|
del 'C:\optlink.zip' |
|
|
|
Write-Host -foregroundcolor green 'Installing Digital Mars implib' |
|
(new-object System.Net.WebClient).DownloadFile('http://ftp.digitalmars.com/bup.zip', 'C:\bup.zip') |
|
$shell = new-object -com shell.application |
|
$shell.NameSpace('C:\').CopyHere($shell.NameSpace('C:\bup.zip').Items(), 0x614) |
|
del 'C:\bup.zip' |
|
|
|
Write-Host -foregroundcolor green 'Installing Git' |
|
(new-object System.Net.WebClient).DownloadFile('https://github.com/git-for-windows/git/releases/download/v2.5.0.windows.1/Git-2.5.0-64-bit.exe', 'C:\git.exe') |
|
(new-object System.Net.WebClient).DownloadFile('https://gist.github.com/MartinNowak/8270666/raw/git.inf', 'C:\git.inf') |
|
Wait-Process -id (Start-Process C:\git.exe -ArgumentList "/SILENT","/LOADINF=git.inf" -PassThru).id |
|
del 'C:\git.exe' |
|
|
|
Write-Host -foregroundcolor green 'Installing HTML Help Workshop' |
|
(new-object System.Net.WebClient).DownloadFile('http://download.microsoft.com/download/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe', 'C:\htmlhelp.exe') |
|
Wait-Process -id (Start-Process C:\htmlhelp.exe -ArgumentList '"/T:C:\Program Files (x86)\HTML Help Workshop"',"/C","/Q" -PassThru).id |
|
del 'C:\htmlhelp.exe' |
|
|
|
Write-Host -foregroundcolor green 'Installing NSIS' |
|
(new-object System.Net.WebClient).DownloadFile('https://sourceforge.net/projects/nsis/files/NSIS%203/3.05/nsis-3.05-setup.exe', 'C:\nsis-3.05-setup.exe') |
|
(new-object System.Net.WebClient).DownloadFile('http://nsis.sourceforge.net/mediawiki/images/c/c9/Inetc.zip', 'C:\Inetc.zip') |
|
Wait-Process -id (Start-Process C:\nsis-3.05-setup.exe -ArgumentList "/S" -PassThru).id |
|
$shell = new-object -com shell.application |
|
$shell.NameSpace('C:\Program Files (x86)\NSIS\Plugins').CopyHere($shell.NameSpace('C:\Inetc.zip\Plugins').Items(), 0x614) |
|
del 'C:\nsis-3.05-setup.exe' |
|
del 'C:\Inetc.zip' |
|
|
|
Write-Host -foregroundcolor green 'Configuring environment variables' |
|
$oldPath=(Get-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).Path |
|
$newPath=$oldPath+';C:\Program Files (x86)\Git\cmd;C:\dm\bin' |
|
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH -Value $newPath |
|
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Session Manager\Environment' -Name LDC_VSDIR -Value 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\' |
|
|
|
Write-Host -foregroundcolor green 'OK' |
|
|
|
|
|
del 'C:\setup.ps1' |
Uses of gist.github.com in both Win7x64-box.md and on lines L20 and L39 of setup.ps1 should be changed to gist.githubusercontent.com. These urls are redirected to the correct location when used in a browser but are not redirected when used in a script or from the shell.