Invoke-AzFirewallPacketCaptureOperation
在 Azure 防火墙上调用启动/状态/停止数据包捕获作请求
语法
Default (默认值)
Invoke-AzFirewallPacketCaptureOperation
-AzureFirewall <PSAzureFirewall>
-Parameter <PSAzureFirewallPacketCaptureParameters>
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
在 Azure 防火墙上调用启动/状态/停止数据包捕获作请求
示例
示例 1:在 Azure 防火墙上调用启动数据包捕获作
$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
此示例使用提到的参数在 Azure 防火墙上调用启动数据包捕获请求。
示例 2:在 Azure 防火墙上调用检查状态数据包捕获作
$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
此示例使用提到的参数在 Azure 防火墙上调用检查状态数据包捕获请求。
示例 3:在 Azure 防火墙上调用停止数据包捕获作
$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
此示例使用提到的参数在 Azure 防火墙上调用停止数据包捕获请求。
参数
-AsJob
在后台运行 cmdlet
参数属性
| 类型: | SwitchParameter |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-AzureFirewall
The AzureFirewall
参数属性
| 类型: | PSAzureFirewall |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | True |
| 来自管道的值: | True |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-Confirm
在运行 cmdlet 之前,提示你进行确认。
参数属性
| 类型: | SwitchParameter |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
| 别名: | cf |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
参数属性
| 类型: | IAzureContextContainer |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
| 别名: | AzContext, AzureRmContext, AzureCredential |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-Parameter
数据包捕获参数
参数属性
| 类型: | PSAzureFirewallPacketCaptureParameters |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | True |
| 来自管道的值: | True |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-WhatIf
显示 cmdlet 运行时会发生什么情况。 命令脚本未运行。
参数属性
| 类型: | SwitchParameter |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
| 别名: | 无线 |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
CommonParameters
此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters。