forked from miriamxyra/VirtualNinjaTraining2024
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGet-FirewallRules.ps1
More file actions
27 lines (21 loc) · 854 Bytes
/
Copy pathGet-FirewallRules.ps1
File metadata and controls
27 lines (21 loc) · 854 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<#
.SYNOPSIS
This script retrieves the firewall rules associated with a specific firewall profile.
.DESCRIPTION
This script retrieves the firewall rules for the specified firewall profile.
It utilizes the Get-NetFirewallProfile cmdlet to obtain the firewall profile information
and then retrieves the associated firewall rules using the Get-NetFirewallRule cmdlet.
.PARAMETER ProfileName
Specifies the name of the firewall profile for which the rules are to be retrieved.
This parameter is mandatory.
.EXAMPLE
.\Get-FirewallRules.ps1 -ProfileName "Public"
Retrieves all firewall rules associated with the "Public" firewall profile.
.NOTES
Author: Miriam Wiesner, @miriamxyra
#>
Param (
[parameter(Mandatory=$true)]
[string]$ProfileName
)
Get-NetFirewallProfile -Name $ProfileName | Get-NetFirewallRule