Get-AzNetworkWatcherTroubleshootingResult

取得先前執行或目前正在執行疑難解答作業的疑難解答結果。

Syntax

Get-AzNetworkWatcherTroubleshootingResult
   -NetworkWatcher <PSNetworkWatcher>
   -TargetResourceId <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzNetworkWatcherTroubleshootingResult
   -NetworkWatcherName <String>
   -ResourceGroupName <String>
   -TargetResourceId <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzNetworkWatcherTroubleshootingResult
   -Location <String>
   -TargetResourceId <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

Get-AzNetworkWatcherTroubleshootingResult Cmdlet 會從先前執行或目前執行的 Start-AzNetworkWatcherResourceTroubleshooting 作業取得疑難解答結果。 如果疑難解答作業目前正在進行中,則此作業可能需要幾分鐘的時間才能完成。 目前支援 虛擬網絡 閘道和 連線。

範例

範例 1:開始對 虛擬網絡 閘道進行疑難解答並擷取結果

$nw = Get-AzResource | Where-Object {$_.ResourceType -eq "Microsoft.Network/networkWatchers" -and $_.Location -eq "WestCentralUS" } 
$networkWatcher = Get-AzNetworkWatcher -Name $nw.Name -ResourceGroupName $nw.ResourceGroupName 

$target = '/subscriptions/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{vnetGatewayName}'
$storageId = '/subscriptions/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{storageAccountName}'
$storagePath = 'https://{storageAccountName}.blob.core.windows.net/troubleshoot'

Start-AzNetworkWatcherResourceTroubleshooting -NetworkWatcher $networkWatcher -TargetResourceId $target -StorageId $storageId -StoragePath $storagePath

Get-AzNetworkWatcherTroubleshootingResult -NetworkWatcher $NW -TargetResourceId $target

上述範例會開始對虛擬網路網關進行疑難解答。 此作業可能需要數分鐘才能完成。 疑難解答開始之後,會對資源進行 Get-AzNetworkWatcherTroubleshootingResult 呼叫,以擷取此呼叫的結果。

參數

-DefaultProfile

用於與 azure 通訊的認證、帳戶、租用戶和訂用帳戶。

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Location

網路監看員的位置。

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-NetworkWatcher

網路監看員資源。

Type:PSNetworkWatcher
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-NetworkWatcherName

網路監看員的名稱。

Type:String
Aliases:Name
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ResourceGroupName

網路監看員資源群組的名稱。

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-TargetResourceId

目標資源標識碼。

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

輸入

PSNetworkWatcher

String

輸出

PSTroubleshootingResult

備註

關鍵詞:azure, azurerm, arm, 資源, 管理, 管理員, 網路, 網路功能, 網路監看員, 疑難解答, VPN, 連線