Bearbeiten

Freigeben über


Get-AzAutomationSoftwareUpdateMachineRun

Gets a list of azure automation software update configuration machine runs.

Syntax

Get-AzAutomationSoftwareUpdateMachineRun
   [-Status <SoftwareUpdateMachineRunStatus>]
   [-TargetComputer <String>]
   [-ResourceGroupName] <String>
   [-AutomationAccountName] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzAutomationSoftwareUpdateMachineRun
   -Id <Guid>
   [-ResourceGroupName] <String>
   [-AutomationAccountName] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzAutomationSoftwareUpdateMachineRun
   [-SoftwareUpdateRunId <Guid>]
   [-Status <SoftwareUpdateMachineRunStatus>]
   [-TargetComputer <String>]
   [-ResourceGroupName] <String>
   [-AutomationAccountName] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzAutomationSoftwareUpdateMachineRun
   [-SoftwareUpdateRun <SoftwareUpdateRun>]
   [-Status <SoftwareUpdateMachineRunStatus>]
   [-TargetComputer <String>]
   [-ResourceGroupName] <String>
   [-AutomationAccountName] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

This cmdlet returns a list of machine runs. Each software update run will trigger a machine run for each of the software update configuration target machine. To get a specific machine run, pass the Id parameter. You can list all the machine runs, all runs for a specific computer, all runs with specific status by passing the corresponding parameters.

Examples

Example 1

This example returns all failed machine runs for the specified azure virtual machine.

$targetComputer = "/subscriptions/22e2445a-0984-4fa5-86a4-0280d76c4b2c/resourceGroups/compute/providers/Microsoft.Compute/virtualMachines/myvm"
Get-AzAutomationSoftwareUpdateMachineRun -ResourceGroupName "mygroup" `
                                                      -AutomationAccountName "myaccount" `
                                                      -TargetComputer $targetComputer `
                                                      -Status Failed

MachineRunId          : 0033d6d6-828d-4712-adab-293cc4fc8809
TargetComputer        : /subscriptions/22e2445a-0984-4fa5-86a4-0280d76c4b2c/resourceGroups/compute/providers/Microsoft.Compute/virtualMachines/myvm
TargetComputerType    : AzureVirtualMachines
SoftwareUpdateRunId   : 46568d26-0182-49b2-8bfd-af3455780397
OperatingSystem       : Windows
Status                : Failed
ResourceGroupName     : mygroup
AutomationAccountName : myaccount
Name                  : 0033d6d6-828d-4712-adab-293cc4fc8809
CreationTime          : 5/17/2018 2:06:44 AM +00:00
LastModifiedTime      : 5/17/2018 2:08:49 AM +00:00

Parameters

-AutomationAccountName

The automation account name.

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

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

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

-Id

Id of the software update machine run.

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

-ResourceGroupName

The resource group name.

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

-SoftwareUpdateRun

The software update run.

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

-SoftwareUpdateRunId

Id of the software update run.

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

-Status

Status of the machine run.

Type:Nullable<T>[SoftwareUpdateMachineRunStatus]
Accepted values:NotStarted, InProgress, Succeeded, Failed, MaintenanceWindowExceeded, FailedToStart
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-TargetComputer

target computer for the machine run. Can be either a non-az computer name or an azure VM resource id.

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

Inputs

Guid

SoftwareUpdateRun

Nullable<T>[[Microsoft.Azure.Commands.Automation.Model.UpdateManagement.SoftwareUpdateMachineRunStatus, Microsoft.Azure.PowerShell.Cmdlets.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]

String

Outputs

SoftwareUpdateMachineRun