rem replace all instances of alyssasmith.id.au with your own values, as well as the url for authorized keys powershell -Command "iwr https://github.com/PowerShell/PowerShell/releases/download/v7.1.3/PowerShell-7.1.3-win-x64.msi -OutFile c:\powershell.msi" msiexec /i c:\powershell.msi /quiet "C:\Program Files\PowerShell\7\pwsh" -Command "Invoke-WebRequest https://swupdate.openvpn.org/community/releases/openvpn-install-2.4.11-I601-Win10.exe -OutFile c:\openvpn-setup.exe" c:\openvpn-setup.exe /S "C:\Program Files\PowerShell\7\pwsh" -Command "set-service -name OpenVPNService -StartupType Automatic" netsh advfirewall firewall add rule name="3389" dir=in action=allow protocol=tcp localport=3389 "C:\Program Files\PowerShell\7\pwsh" -Command "Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0" "C:\Program Files\PowerShell\7\pwsh" -Command "New-ItemProperty -Path 'HKLM:\SOFTWARE\OpenSSH' -Name DefaultShell -Value 'C:\Program Files\PowerShell\7\pwsh.exe' -PropertyType String -Force" netsh advfirewall firewall add rule name="22" dir=in action=allow protocol=tcp localport=22 "C:\Program Files\PowerShell\7\pwsh" -Command "iwr example.com -OutFile c:\programdata\ssh\administrators_authorized_keys" "C:\Program Files\PowerShell\7\pwsh" -Command "$acl = Get-Acl C:\ProgramData\ssh\administrators_authorized_keys; $acl.SetAccessRuleProtection($true, $false); $administratorsRule = New-Object system.security.accesscontrol.filesystemaccessrule('Administrators','FullControl','Allow'); $systemRule = New-Object system.security.accesscontrol.filesystemaccessrule('SYSTEM','FullControl','Allow'); $acl.SetAccessRule($administratorsRule); $acl.SetAccessRule($systemRule); $acl | Set-Acl" "C:\Program Files\PowerShell\7\pwsh" -Command "set-service -name sshd -StartupType Automatic" "C:\Program Files\PowerShell\7\pwsh" -Command "iwr -useb get.scoop.sh | iex; scoop install git; scoop update; scoop bucket add extras; scoop install chromium rclone" "C:\Program Files\PowerShell\7\pwsh" -Command "$_host = ((iwr http://169.254.169.254/v1/hostname).Content -replace '.w.alyssasmith.id.au$'); rename-computer -newname $_host"