$ErrorActionPreference = "Stop" # Switch network connection to private mode # Required for WinRM firewall rules $profile = Get-NetConnectionProfile Set-NetConnectionProfile -Name $profile.Name -NetworkCategory Private # Enable WinRM service winrm quickconfig -quiet winrm set winrm/config/service '@{AllowUnencrypted="true"}' winrm set winrm/config/service/auth '@{Basic="true"}' # Disable IPv6 because it leads to problems with proxmox terraform Get-NetAdapter | foreach { Disable-NetAdapterBinding -InterfaceAlias $_.Name -ComponentID ms_tcpip6 } # Reset auto logon count # https://docs.microsoft.com/en-us/windows-hardware/customize/desktop/unattend/microsoft-windows-shell-setup-autologon-logoncount#logoncount-known-issue Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name AutoLogonCount -Value 0 # Run a custom installer script if there is one $customInstaller = Join-Path $PSScriptRoot "custom\custom.ps1" if (Test-Path $customInstaller) { & $customInstaller } # Add French Keyboard Set-WinUserLanguageList fr-FR,en-US -Force # Set time zone to Europe/Paris Set-TimeZone -Id "Romance Standard Time" # Allow Remote Desktop Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server" -Name "fDenyTSConnections" -Value 0 Enable-NetFirewallRule -DisplayGroup "Remote Desktop" # Allow script execution Set-ExecutionPolicy -ExecutionPolicy Bypass