Skip to content

Instantly share code, notes, and snippets.

@Nonary
Nonary / MoonlightExternalFirewallScript.psm1
Created May 27, 2022 07:16
NVIDIA/Moonlight External Firewall Block/Unlocking Script
function Enable-MoonlightExternally() {
Get-ScheduledJob -Name "Wait for Moonlight to Terminate" -ErrorAction SilentlyContinue | Unregister-ScheduledJob -ErrorAction SilentlyContinue
start_monitoring_job
Write-Host "External Connections are permitted for moonlight until the next time you disconnect a stream."
}
function Disable-MoonlightExternally {
Get-ScheduledJob -Name "Wait for Moonlight to Terminate" -ErrorAction SilentlyContinue | Unregister-ScheduledJob -ErrorAction SilentlyContinue
Get-NetFirewallRule | Where-Object {$_.DisplayName -like '*NVIDIA Shield*'} | Get-NetFirewallAddressFilter | Set-NetFirewallAddressFilter -RemoteAddress "192.168.1.0/24"