# Run as Administrator on Windows ARM64 Parallels VM
# Installs OpenSSH Server and VS Build Tools for native library compilation

# Install OpenSSH Server
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
Start-Service sshd
Set-Service -Name sshd -StartupType Automatic

# Allow SSH through firewall
New-NetFirewallRule -Name "OpenSSH-Server" -DisplayName "OpenSSH Server" -Direction Inbound -Protocol TCP -LocalPort 22 -Action Allow -ErrorAction SilentlyContinue

Write-Host "SSH server installed and running."
Write-Host "Connect with: ssh $env:USERNAME@<vm-ip>"
Write-Host ""
Write-Host "Next: install VS Build Tools with C++ ARM64 support."
Write-Host "Run this in a browser or with curl:"
Write-Host "  https://aka.ms/vs/17/release/vs_BuildTools.exe"
Write-Host ""
Write-Host "Install with: vs_BuildTools.exe --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.VC.Tools.ARM64 --includeRecommended --passive"
