# Execute with Administrator rights$path = $MyInvocation.MyCommand.Pathif ($args[0] -ne $null) {$path = $args[0]}$path = Split-Path -Path $path$windowsID = [System.Security.Principal.WindowsIdentity]::GetCurrent()$windowsPrincipal = New-Object System.Security.Principal.WindowsPrincipal($windowsID)$adminRole=[System.Security.Principal.WindowsBuiltInRole]::Administratorif ($windowsPrincipal.IsInRole($adminRole)) {$Host.UI.RawUI.WindowTitle = $myInvocation.MyCommand.Definition + "(Elevated)"$Host.UI.RawUI.BackgroundColor = "DarkBlue"clear-host}else {$newProcess = New-Object System.Diagnostics.ProcessStartInfo "PowerShell";$newProcess.WorkingDirectory = $path;$newProcess.Arguments = $myInvocation.MyCommand.Definition;$newProcess.Verb = "runas";[System.Diagnostics.Process]::Start($newProcess);exit}# Set RDP enabledSet-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server" -Name "fDenyTSConnections" –Value 0# Create firewall ruleNew-NetFirewallRule -DisplayName "Remote Desktop Allow TCP" -Program "%SystemRoot%\system32\svchost.exe" -Action Allow -Protocol TCP -LocalPort 3389 -Direction Inbound -Enabled TrueNew-NetFirewallRule -DisplayName "Remote Desktop Allow UDP" -Program "%SystemRoot%\system32\svchost.exe" -Action Allow -Protocol UDP -LocalPort 3389 -Direction Inbound -Enabled True# Add user to RDU group$User = $env:USERNAMEAdd-LocalGroupMember -SID "S-1-5-32-555" -Member $User
Moonlight (formerly Limelight) is an open source implementation of the NVIDIA GameStream protocol. We implemented the protocol used by NVIDIA Shield and wrote a set of third-party clients.