-
Notifications
You must be signed in to change notification settings - Fork 3
/
screen-resolution.ps1
37 lines (24 loc) · 992 Bytes
/
screen-resolution.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
34
35
36
37
$ErrorActionPreference = 'Stop'; # stop on all errors
$Password = 'vagrant'
$RdpPassword = 'bfnhQ8UXRQ7R4eqb'
##
# Install Chocolatey - https://chocolatey.org
##
Set-ExecutionPolicy Bypass; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
##
# Install RDP Wrapper - required for Windows 10 only - comment out for Windows Server 2012R2 and 2016
##
choco install -y rdpwrapper
##
# Install Screen Resolution
##
choco pack C:\vagrant\screen-resolution.nuspec --outputdirectory C:\vagrant
choco install -y screen-resolution --params "'/Width:1366 /Height:768 /Password:$Password /RdpPassword:$RdpPassword'" -d -s C:\vagrant --force
##
# Configure AutoLogon
##
# cleanup original vagrant autologon setup
$RegPath ="HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
Remove-ItemProperty -Path $RegPath -Name "AutoLogonCount" -ErrorAction SilentlyContinue
choco install -y autologon
autologon rdp_local $env:userdomain $RdpPassword