mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-01-28 08:38:38 +01:00
Update check-firewall.ps1
This commit is contained in:
parent
3e3dd13302
commit
7e777f07ee
@ -5,7 +5,7 @@
|
||||
This PowerShell script queries and prints firewall details.
|
||||
.EXAMPLE
|
||||
PS> ./check-firewall
|
||||
✅ AMD Ryzen 5 5500U with Radeon Graphics (CPU0, 2100MHz, 31.3°C)
|
||||
✅ Firewall enabled
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
@ -14,7 +14,8 @@
|
||||
|
||||
try {
|
||||
if ($IsLinux) {
|
||||
# TODO
|
||||
Write-Host "✅ Firewall " -noNewline
|
||||
& sudo ufw status
|
||||
} else {
|
||||
$enabled = (gp 'HKLM:\SYSTEM\ControlSet001\Services\SharedAccess\Parameters\FirewallPolicy\DomainProfile').EnableFirewall
|
||||
if ($enabled) {
|
||||
@ -28,4 +29,4 @@ try {
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user