你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Get-AzDeploymentScriptLog

获取部署脚本执行的日志。

语法

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>]

说明

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

部署脚本的完全限定资源 ID。 示例:/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

输入

String

PsDeploymentScript

输出

PsDeploymentScriptLog