New-AzAutomationSoftwareUpdateConfiguration
Membuat konfigurasi pembaruan perangkat lunak azure automation terjadwal.
Sintaks
New-AzAutomationSoftwareUpdateConfiguration
-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[]>]
[-ResourceGroupName] <String>
[-AutomationAccountName] <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzAutomationSoftwareUpdateConfiguration
-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[]>]
[-ResourceGroupName] <String>
[-AutomationAccountName] <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Deskripsi
Membuat konfigurasi pembaruan perangkat lunak yang berjalan sesuai jadwal untuk memperbarui daftar komputer. Komputer mencakup komputer virtual azure atau komputer non-az.
Contoh
Contoh 1
Membuat konfigurasi pembaruan perangkat lunak untuk menginstal pembaruan penting pada dua komputer virtual Windows azure sekali setiap Sabtu pukul 21.00. Durasi pembaruan diatur ke 2 jam dalam contoh ini.
$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 :
Parameter
-AutomationAccountName
Nama akun automasi.
Jenis: | String |
Position: | 1 |
Nilai default: | None |
Diperlukan: | True |
Terima input alur: | True |
Terima karakter wildcard: | False |
-AzureQuery
Kueri azure grup dinamis.
Jenis: | AzureQueryProperties[] |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | True |
Terima karakter wildcard: | False |
-AzureVMResourceId
Id sumber daya untuk komputer virtual azure.
Jenis: | String[] |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | True |
Terima karakter wildcard: | False |
-Confirm
Meminta Anda mengonfirmasi sebelum menjalankan cmdlet.
Jenis: | SwitchParameter |
Alias: | cf |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | False |
Terima karakter wildcard: | False |
-DefaultProfile
Kredensial, akun, penyewa, dan langganan yang digunakan untuk komunikasi dengan Azure.
Jenis: | IAzureContextContainer |
Alias: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | False |
Terima karakter wildcard: | False |
-Duration
Durasi maksimum untuk pembaruan.
Jenis: | TimeSpan |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | True |
Terima karakter wildcard: | False |
-ExcludedKbNumber
Jumlah KB pembaruan yang dikecualikan.
Jenis: | String[] |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | True |
Terima karakter wildcard: | False |
-ExcludedPackageNameMask
Masker paket Linux yang dikecualikan.
Jenis: | String[] |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | True |
Terima karakter wildcard: | False |
-IncludedKbNumber
Jumlah KB pembaruan yang disertakan.
Jenis: | String[] |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | True |
Terima karakter wildcard: | False |
-IncludedPackageClassification
Termasuk klasifikasi paket Linux.
Jenis: | LinuxPackageClasses[] |
Nilai yang diterima: | Unclassified, Critical, Security, Other |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | True |
Terima karakter wildcard: | False |
-IncludedPackageNameMask
Masker paket Linux yang disertakan.
Jenis: | String[] |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | True |
Terima karakter wildcard: | False |
-IncludedUpdateClassification
Klasifikasi Windows Update yang disertakan.
Jenis: | WindowsUpdateClasses[] |
Nilai yang diterima: | Unclassified, Critical, Security, UpdateRollup, FeaturePack, ServicePack, Definition, Tools, Updates |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | True |
Terima karakter wildcard: | False |
-Linux
Menunjukkan bahwa konfigurasi pembaruan perangkat lunak yang menargetkan komputer sistem operasi Linux.
Jenis: | SwitchParameter |
Position: | Named |
Nilai default: | None |
Diperlukan: | True |
Terima input alur: | True |
Terima karakter wildcard: | False |
-NonAzureComputer
Nama komputer non-Az.
Jenis: | String[] |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | True |
Terima karakter wildcard: | False |
-NonAzureQuery
Kueri non Azure grup dinamis.
Jenis: | NonAzureQueryProperties[] |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | True |
Terima karakter wildcard: | False |
-PostTaskRunbookName
Posting tugas.
Jenis: | String |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | True |
Terima karakter wildcard: | False |
-PostTaskRunbookParameter
Parameter tugas posting.
Jenis: | Hashtable |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | True |
Terima karakter wildcard: | False |
-PreTaskRunbookName
Tugas sebelumnya.
Jenis: | String |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | True |
Terima karakter wildcard: | False |
-PreTaskRunbookParameter
Parameter pra tugas.
Jenis: | Hashtable |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | True |
Terima karakter wildcard: | False |
-RebootOnly
Menunjukkan bahwa konfigurasi pembaruan perangkat lunak hanya akan Me-Reboot komputer.
Jenis: | SwitchParameter |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | True |
Terima karakter wildcard: | False |
-RebootSetting
Reboot Pengaturan.
Jenis: | RebootSetting |
Nilai yang diterima: | IfRequired, Never, Always, RebootOnly |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | True |
Terima karakter wildcard: | False |
-ResourceGroupName
Nama grup sumber daya.
Jenis: | String |
Position: | 0 |
Nilai default: | None |
Diperlukan: | True |
Terima input alur: | True |
Terima karakter wildcard: | False |
-Schedule
Jadwalkan objek yang digunakan untuk konfigurasi pembaruan perangkat lunak.
Jenis: | Schedule |
Position: | Named |
Nilai default: | None |
Diperlukan: | True |
Terima input alur: | True |
Terima karakter wildcard: | False |
-WhatIf
Menunjukkan apa yang akan terjadi jika cmdlet berjalan. Cmdlet tidak dijalankan.
Jenis: | SwitchParameter |
Alias: | wi |
Position: | Named |
Nilai default: | None |
Diperlukan: | False |
Terima input alur: | False |
Terima karakter wildcard: | False |
-Windows
Menunjukkan bahwa konfigurasi pembaruan perangkat lunak yang menargetkan komputer sistem operasi windows.
Jenis: | SwitchParameter |
Position: | Named |
Nilai default: | None |
Diperlukan: | True |
Terima input alur: | True |
Terima karakter wildcard: | False |
Input
String[]
Output
Azure PowerShell