Invoke-AzFirewallPacketCaptureOperation
Invokes a Start/Status/Stop packet capture operation request on Azure Firewall
Syntax
Default (Default)
Invoke-AzFirewallPacketCaptureOperation
-AzureFirewall <PSAzureFirewall>
-Parameter <PSAzureFirewallPacketCaptureParameters>
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Invokes a Start/Status/Stop packet capture operation request on Azure Firewall
Examples
Example 1: Invokes a start packet capture operation on Azure Firewall
$azureFirewall = New-AzFirewall -Name $azureFirewallName -ResourceGroupName $rgname -Location $location
$azFirewall = Get-AzFirewall -Name $azureFirewallName -ResourceGroupName $rgname
# Create a filter rules
$filter1 = New-AzFirewallPacketCaptureRule -Source "10.0.0.2","192.123.12.1" -Destination "172.32.1.2" -DestinationPort "80","443"
$filter2 = New-AzFirewallPacketCaptureRule -Source "10.0.0.5" -Destination "172.20.10.2" -DestinationPort "80","443"
# Create the firewall packet capture parameters
$Params = New-AzFirewallPacketCaptureParameter -DurationInSeconds 1200 -NumberOfPacketsToCapture 20000 -SASUrl $sasurl -Filename "AzFwPowershellPacketCapture" -Flag "Syn","Ack" -Protocol "Any" -Filter $Filter1, $Filter2 -Operation "Start"
# Invoke a firewall packet capture
Invoke-AzFirewallPacketCaptureOperation -AzureFirewall $azureFirewall -Parameter $Params
This example invokes a start packet capture request on azure firewall with the parameters mentioned.
Example 2: Invokes a check status packet capture operation on Azure Firewall
$azureFirewall = New-AzFirewall -Name $azureFirewallName -ResourceGroupName $rgname -Location $location
$azFirewall = Get-AzFirewall -Name $azureFirewallName -ResourceGroupName $rgname
# Create the firewall packet capture parameters
$Params = New-AzFirewallPacketCaptureParameter -Operation "Status"
# Invoke a firewall packet capture
Invoke-AzFirewallPacketCaptureOperation -AzureFirewall $azureFirewall -Parameter $Params
This example invokes a check status packet capture request on azure firewall with the parameters mentioned.
Example 3: Invokes a stop packet capture operation on Azure Firewall
$azureFirewall = New-AzFirewall -Name $azureFirewallName -ResourceGroupName $rgname -Location $location
$azFirewall = Get-AzFirewall -Name $azureFirewallName -ResourceGroupName $rgname
# Create the firewall packet capture parameters
$Params = New-AzFirewallPacketCaptureParameter -Operation "Stop"
# Invoke a firewall packet capture
Invoke-AzFirewallPacketCaptureOperation -AzureFirewall $azureFirewall -Parameter $Params
This example invokes a stop packet capture request on azure firewall with the parameters mentioned.
Parameters
-AsJob
Run cmdlet in the background
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-AzureFirewall
The AzureFirewall
Parameter properties
| Type: | PSAzureFirewall |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | True |
| Value from pipeline: | True |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | cf |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with Azure.
Parameter properties
| Type: | IAzureContextContainer |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-Parameter
The packet capture parameters
Parameter properties
| Type: | PSAzureFirewallPacketCaptureParameters |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | True |
| Value from pipeline: | True |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | wi |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.