Get-AzDeploymentScriptLog
取得部署腳本執行的記錄。
Syntax
Get-AzDeploymentScriptLog
[-ResourceGroupName] <String>
[-Name] <String>
[[-Tail] <Int32>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzDeploymentScriptLog
[-DeploymentScriptResourceId] <String>
[[-Tail] <Int32>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzDeploymentScriptLog
[-DeploymentScriptObject] <PsDeploymentScript>
[[-Tail] <Int32>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
Get-AzDeploymentScriptLog Cmdlet 會取得部署腳本執行的記錄。
範例
範例 1
Get-AzDeploymentScriptLog -Name MyDeploymentScript -ResourceGroupName DS-TestRg
取得資源群組 DS-TestRG 中名稱為 MyDeploymentScript 的部署腳本記錄。
範例 2
Get-AzDeploymentScriptLog -Name MyDeploymentScript -ResourceGroupName DS-TestRg -Tail 3
取得資源群組 DS-TestRG 中名稱為 MyDeploymentScript 之部署腳本的最後 3 行記錄。
範例 3
$ds = Get-AzDeploymentScript -Name MyDeploymentScript -ResourceGroupName DS-TestRg
Get-AzDeploymentScriptLog -DeploymentScriptInputObject $ds
第一個命令會取得資源群組 DS-TestRG 中名稱為 MyDeploymentScript 的部署腳本。 第二個命令會取得指定部署腳本的記錄。
參數
-DefaultProfile
用於與 Azure 通訊的認證、帳戶、租用戶和訂用帳戶。
Type: | IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DeploymentScriptObject
部署腳本 PowerShell 物件。
Type: | PsDeploymentScript |
Aliases: | DeploymentScriptInputObject |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-DeploymentScriptResourceId
部署腳本的完整資源標識碼。 範例:/subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Resources/deploymentScripts/{deploymentScriptName}
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Name
部署文稿的名稱。
Type: | String |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ResourceGroupName
資源群組的名稱。
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Tail
將輸出限制為最後 n 行
Type: | Int32 |
Position: | 2 |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |