Skip to content

Instantly share code, notes, and snippets.

@nesh
nesh / destiny2-disable-firewall.ps1
Created February 15, 2021 12:27
Destiny 2 enable/disable firewall for solo strikes
<# This code requests administrator permissions so that the script can modify your Windows Firewall rules as needed #>
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit }
<# Once user input is detected, the script resumes and removes the port blocks, restoring things to how they were prior to running #>
Remove-NetFirewallRule -DisplayName "Destiny2-Solo-1"
Remove-NetFirewallRule -DisplayName "Destiny2-Solo-2"
Remove-NetFirewallRule -DisplayName "Destiny2-Solo-3"
Remove-NetFirewallRule -DisplayName "Destiny2-Solo-4"