get latest client from github depending on os architecture
replace $username and use $env:AppData (installations via RDP will fail otherwise)
use $env:Temp instead of C:\temp (there are rare cases when windows is not installed on c: plus we already have an environment variable defined for this)
use $env:ProgramFiles instead of hardcoded path (see $env:Temp)
use $env:WinDir instead of hardcoded path (see $env:Temp)
use a function to output ID and Password
use a variable for content of RustDesk2.toml file
use a longer password (8 chars is definitely not enough, especially for unattended access)
cleanup temp files
try to use native powershell commands Stop-Process instead of "taskkill" and Start-Service instead of "net start"
little refactoring: