Delen via


New-AzSnapshotConfig

Hiermee maakt u een configureerbaar momentopnameobject.

Syntax

New-AzSnapshotConfig
   [[-SkuName] <StorageAccountTypes>]
   [[-OsType] <OperatingSystemTypes>]
   [[-DiskSizeGB] <Int32>]
   [[-Location] <String>]
   [-Tag <Hashtable>]
   [-CreateOption <DiskCreateOption>]
   [-StorageAccountId <String>]
   [-ImageReference <ImageDiskReference>]
   [-SourceUri <String>]
   [-SourceResourceId <String>]
   [-EncryptionSettingsEnabled <Boolean>]
   [-DiskEncryptionKey <KeyVaultAndSecretReference>]
   [-KeyEncryptionKey <KeyVaultAndKeyReference>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Met de cmdlet New-AzSnapshotConfig wordt een configureerbaar momentopnameobject gemaakt.

Voorbeelden

Voorbeeld 1

PS C:\> $snapshotconfig = New-AzSnapshotConfig -Location 'Central US' -DiskSizeGB 5 -AccountType StandardLRS -OsType Windows -CreateOption Empty -EncryptionSettingsEnabled $true;
PS C:\> $secretUrl = https://myvault.vault-int.azure-int.net/secrets/123/;
PS C:\> $secretId = '/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup01/providers/Microsoft.KeyVault/vaults/TestVault123';
PS C:\> $keyUrl = https://myvault.vault-int.azure-int.net/keys/456;
PS C:\> $keyId = '/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup01/providers/Microsoft.KeyVault/vaults/TestVault456';
PS C:\> $snapshotconfig = Set-AzSnapshotDiskEncryptionKey -Snapshot $snapshotconfig -SecretUrl $secretUrl -SourceVaultId $secretId;
PS C:\> $snapshotconfig = Set-AzSnapshotKeyEncryptionKey -Snapshot $snapshotconfig -KeyUrl $keyUrl -SourceVaultId $keyId;
PS C:\> New-AzSnapshot -ResourceGroupName 'ResourceGroup01' -SnapshotName 'Snapshot01' -Snapshot $snapshotconfig;

Met de eerste opdracht maakt u een lokaal leeg momentopnameobject met de grootte 5 GB in Standard_LRS opslagaccounttype. Ook wordt het type Windows-besturingssysteem ingesteld en worden versleutelingsinstellingen ingeschakeld. Met de tweede en derde opdrachten worden de instellingen voor schijfversleutelingssleutel en sleutelversleutelingssleutel voor het momentopnameobject ingesteld. De laatste opdracht maakt het momentopnameobject en maakt een momentopname met de naam Snapshot01 in de resourcegroep ResourceGroup01.

Parameters

-Confirm

Hiermee wordt u gevraagd om bevestiging voordat u de cmdlet uitvoert.

Type:SwitchParameter
Aliases:cf
Position:Named
standaardwaarde:None
Vereist:False
Accept pipeline input:False
Accept wildcard characters:False

-CreateOption

Hiermee geeft u op of met deze cmdlet een schijf in de virtuele machine wordt gemaakt op basis van een platform- of gebruikersinstallatiekopieën, een lege schijf wordt gemaakt of een bestaande schijf wordt gekoppeld.

Type:DiskCreateOption
geaccepteerde waarden:Empty, Attach, FromImage, Import, Copy
Position:Named
standaardwaarde:None
Vereist:False
Accept pipeline input:True
Accept wildcard characters:False

-DefaultProfile

De referenties, het account, de tenant en het abonnement die worden gebruikt voor communicatie met Azure.

Type:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
standaardwaarde:None
Vereist:False
Accept pipeline input:False
Accept wildcard characters:False

-DiskEncryptionKey

Hiermee geeft u het sleutelobject voor schijfversleuteling op een momentopname.

Type:KeyVaultAndSecretReference
Position:Named
standaardwaarde:None
Vereist:False
Accept pipeline input:True
Accept wildcard characters:False

-DiskSizeGB

Hiermee geeft u de grootte van de schijf in GB.

Type:Int32
Position:2
standaardwaarde:None
Vereist:False
Accept pipeline input:True
Accept wildcard characters:False

-EncryptionSettingsEnabled

Schakel versleutelingsinstellingen in.

Type:Boolean
Position:Named
standaardwaarde:None
Vereist:False
Accept pipeline input:True
Accept wildcard characters:False

-ImageReference

Hiermee geeft u de afbeeldingsreferentie op een momentopname.

Type:ImageDiskReference
Position:Named
standaardwaarde:None
Vereist:False
Accept pipeline input:True
Accept wildcard characters:False

-KeyEncryptionKey

Hiermee geeft u de sleutelversleutelingssleutel op een momentopname.

Type:KeyVaultAndKeyReference
Position:Named
standaardwaarde:None
Vereist:False
Accept pipeline input:True
Accept wildcard characters:False

-Location

Hiermee geeft u een locatie.

Type:String
Position:3
standaardwaarde:None
Vereist:False
Accept pipeline input:True
Accept wildcard characters:False

-OsType

Hiermee geeft u het type besturingssysteem.

Type:OperatingSystemTypes
geaccepteerde waarden:Windows, Linux
Position:1
standaardwaarde:None
Vereist:False
Accept pipeline input:True
Accept wildcard characters:False

-SkuName

Hiermee geeft u de SKU-naam van het opslagaccount.

Type:StorageAccountTypes
Aliases:AccountType
geaccepteerde waarden:StandardLRS, PremiumLRS
Position:0
standaardwaarde:None
Vereist:False
Accept pipeline input:True
Accept wildcard characters:False

-SourceResourceId

Hiermee geeft u de bronresource-id op.

Type:String
Position:Named
standaardwaarde:None
Vereist:False
Accept pipeline input:True
Accept wildcard characters:False

-SourceUri

Hiermee geeft u de bron-URI.

Type:String
Position:Named
standaardwaarde:None
Vereist:False
Accept pipeline input:True
Accept wildcard characters:False

-StorageAccountId

Hiermee geeft u de opslagaccount-id op.

Type:String
Position:Named
standaardwaarde:None
Vereist:False
Accept pipeline input:True
Accept wildcard characters:False

-Tag

Sleutel-waardeparen in de vorm van een hash-tabel. Voorbeeld:

@{key0="value0";key1=$null;key2="value2"}

Type:Hashtable
Position:Named
standaardwaarde:None
Vereist:False
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

Hiermee wordt weergegeven wat er zou gebeuren als u de cmdlet uitvoert. De cmdlet wordt niet uitgevoerd.

Type:SwitchParameter
Aliases:wi
Position:Named
standaardwaarde:None
Vereist:False
Accept pipeline input:False
Accept wildcard characters:False

Invoerwaarden

None

Deze cmdlet accepteert geen invoer.

Uitvoerwaarden

PSSnapshot