Files
ResourceUsageAPI/publish/configure_firewall.ps1
T

9 lines
372 B
PowerShell

# PowerShell script to create a new inbound rule in Windows Firewall
$port = 5000
$ruleName = "ResourceMonitorServicePublish"
if (Get-NetFirewallRule -DisplayName $ruleName) {
Write-Host "Rule already exists, not creating a new one"
} else {
New-NetFirewallRule -DisplayName $ruleName -Direction Inbound -Protocol TCP -LocalPort $port -Action Allow -Profile Any
}