New-AzAutomationSoftwareUpdateConfiguration
Creates a scheduled azure automation software update configuration.
Syntax
Windows (Default)
New-AzAutomationSoftwareUpdateConfiguration
[-ResourceGroupName] <String>
[-AutomationAccountName] <String>
-Schedule <Schedule>
[-Windows]
[-RebootOnly]
[-AzureVMResourceId <String[]>]
[-PreTaskRunbookName <String>]
[-PostTaskRunbookName <String>]
[-PreTaskRunbookParameter <Hashtable>]
[-PostTaskRunbookParameter <Hashtable>]
[-NonAzureComputer <String[]>]
[-AzureQuery <AzureQueryProperties[]>]
[-NonAzureQuery <NonAzureQueryProperties[]>]
[-Duration <TimeSpan>]
[-RebootSetting <RebootSetting>]
[-IncludedUpdateClassification <WindowsUpdateClasses[]>]
[-ExcludedKbNumber <String[]>]
[-IncludedKbNumber <String[]>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Linux
New-AzAutomationSoftwareUpdateConfiguration
[-ResourceGroupName] <String>
[-AutomationAccountName] <String>
-Schedule <Schedule>
[-Linux]
[-RebootOnly]
[-AzureVMResourceId <String[]>]
[-PreTaskRunbookName <String>]
[-PostTaskRunbookName <String>]
[-PreTaskRunbookParameter <Hashtable>]
[-PostTaskRunbookParameter <Hashtable>]
[-NonAzureComputer <String[]>]
[-AzureQuery <AzureQueryProperties[]>]
[-NonAzureQuery <NonAzureQueryProperties[]>]
[-Duration <TimeSpan>]
[-RebootSetting <RebootSetting>]
[-IncludedPackageClassification <LinuxPackageClasses[]>]
[-ExcludedPackageNameMask <String[]>]
[-IncludedPackageNameMask <String[]>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Creates a software update configuration that runs on a schedule to update a list of computers. Computers include both azure virtual machines or non-az computers.
Examples
Example 1
Creates a software update configuration to install critical updates on two Windows azure virtual machines once every Saturday 9PM. Update duration is set to 2 hours in this example.
$startTime = [DateTimeOffset]"2018-09-13T21:00"
$targetMachines = @(
"/subscriptions/22e2445a-0984-4fa5-86a4-0280d76c4b2c/resourceGroups/compute/providers/Microsoft.Compute/virtualMachines/vm-w-01",
"/subscriptions/22e2445a-0984-4fa5-86a4-0280d76c4b2c/resourceGroups/compute/providers/Microsoft.Compute/virtualMachines/vm-w-02"
)
$duration = New-TimeSpan -Hours 2
$schedule = New-AzAutomationSchedule -ResourceGroupName "mygroup" `
-AutomationAccountName "myaccount" `
-Name MyWeeklySchedule `
-StartTime $startTime `
-DaysOfWeek Saturday `
-WeekInterval 1 `
-ForUpdateConfiguration
New-AzAutomationSoftwareUpdateConfiguration -ResourceGroupName "mygroup" `
-AutomationAccountName "myaccount" `
-Schedule $schedule `
-Windows `
-AzureVMResourceId $targetMachines `
-IncludedUpdateClassification Critical `
-Duration $duration
UpdateConfiguration : Microsoft.Azure.Commands.Automation.Model.UpdateManagement.UpdateConfiguration
ScheduleConfiguration : Microsoft.Azure.Commands.Automation.Model.Schedule
ProvisioningState : Provisioning
ErrorInfo :
ResourceGroupName : mygroup
AutomationAccountName : myaccount
Name : MyWeeklySchedule
CreationTime : 9/14/2018 3:53:27 AM +00:00
LastModifiedTime : 9/14/2018 3:53:27 AM +00:00
Description :
Parameters
-AutomationAccountName
The automation account name.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: 1
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-AzureQuery
Dynamic group azure query.
Parameter properties
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-AzureVMResourceId
Resource Ids for azure virtual machines.
Parameter properties
Type: String [ ]
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Aliases: cf
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with Azure.
Parameter properties
Type: IAzureContextContainer
Default value: None
Supports wildcards: False
DontShow: False
Aliases: AzContext, AzureRmContext, AzureCredential
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Duration
Maximum duration for the update.
Parameter properties
Type: TimeSpan
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-ExcludedKbNumber
KB numbers of excluded updates.
Parameter properties
Type: String [ ]
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
Windows
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-ExcludedPackageNameMask
Excluded Linux package masks.
Parameter properties
Type: String [ ]
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
Linux
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-IncludedKbNumber
KB numbers of included updates.
Parameter properties
Type: String [ ]
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
Windows
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-IncludedPackageClassification
Included Linux package classifications.
Parameter properties
Type: LinuxPackageClasses [ ]
Default value: None
Accepted values: Unclassified, Critical, Security, Other
Supports wildcards: False
DontShow: False
Parameter sets
Linux
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-IncludedPackageNameMask
Included Linux package masks.
Parameter properties
Type: String [ ]
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
Linux
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-IncludedUpdateClassification
Included Windows Update classifications.
Parameter properties
Type: WindowsUpdateClasses [ ]
Default value: None
Accepted values: Unclassified, Critical, Security, UpdateRollup, FeaturePack, ServicePack, Definition, Tools, Updates
Supports wildcards: False
DontShow: False
Parameter sets
Windows
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-Linux
Indicates that the software update configuration targeting Linux operating system machines.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
Linux
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-NonAzureComputer
Non-Az computer names.
Parameter properties
Type: String [ ]
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-NonAzureQuery
Dynamic group non Azure query.
Parameter properties
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-PostTaskRunbookName
Post task.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-PostTaskRunbookParameter
Post task parameter.
Parameter properties
Type: Hashtable
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-PreTaskRunbookName
Pre task.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-PreTaskRunbookParameter
Pre task parameter.
Parameter properties
Type: Hashtable
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-RebootOnly
Indicates that the software update configuration will Only Reboot the machines.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-RebootSetting
Reboot Setting.
Parameter properties
Type: RebootSetting
Default value: None
Accepted values: IfRequired, Never, Always, RebootOnly
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-ResourceGroupName
The resource group name.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: 0
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-Schedule
Schedule object used for software update configuration.
Parameter properties
Type: Schedule
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Aliases: wi
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Windows
Indicates that the software update configuration targeting windows operating system machines.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
Windows
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters .
Outputs