Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
Protect-TemplateDisk
- Module:
- ShieldedVMTemplate Module
Prepares a signed template disk (.VHDX) which can be used to provision new shielded virtual machines.
Syntax
SpecifyVolumeNameAndVersion (Default)
Protect-TemplateDisk
-Path <String>
-TemplateName <String>
-Version <Version>
-Certificate <X509Certificate2>
[-ProtectedTemplateTargetDiskType <ProtectedTemplateTargetDiskType>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
PopulateFrom
Protect-TemplateDisk
-Path <String>
-PopulateFrom <String>
-Certificate <X509Certificate2>
[-TemplateName <String>]
[-Version <Version>]
[-ProtectedTemplateTargetDiskType <ProtectedTemplateTargetDiskType>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
SpecializedDiskParameterSet
Protect-TemplateDisk
-Path <String>
[-DiskIsAlreadySpecialized]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Protect-TemplateDisk cmdlet prepares a virtual hard disk to be used for provisioning shielded virtual machines. The virtual hard disk must use the VHDX format and contain a generalized OS image. The VHDX will be modified in place, and can only be used with shielded virtual machines after the process is complete.
Examples
Example 1: Prepare a template disk by populating existing values
PS C:\>Protect-TemplateDisk -Certificate $certificate -PopulateFrom "ExistingPreparedTemplate.vhdx" -Path "NewTemplate.vhdx" -TemplateName "Windows Server 2016"
This command prepares the .vhdx that the Path specifies. The command uses the version information from ExistingPreparedTemplate.vhdx. The command specifies the template name "Windows Server 2016".
Example 2: Prepare a template disk by specifying name and version
PS C:\>Protect-TemplateDisk -Certificate $certificate -Path "WindowsServer2016-ShieldedTemplate.vhdx" -TemplateName "Windows Server 2016" -Version 1.0.0.0
This command prepares the .vhdx that the Path specifies. The command uses the name and version information specified by the TemplateName and Version parameters.
Parameters
-Certificate
Specifies the certificate used to sign metadata including the disk name, version, and hash calculated during the preparation process. The specified certificate must have a private key installed on the local machine.
Parameter properties
| Type: | X509Certificate2 |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
| Type: | SwitchParameter |
| Default value: | False |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | cf |
Parameter sets
-DiskIsAlreadySpecialized
Indicates the disk has already been prepared as a signed template disk, but its contents have since changed.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-Path
Specifies the path to the template disk (.VHDX) to be prepared.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-PopulateFrom
Specifies the path of a template disk that contains a previously published volume signature catalog. The disk name, version, and certificate will be used as defaults for the new template disk.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-ProtectedTemplateTargetDiskType
Specifies the type of OS installed on the VHDX.
Parameter properties
| Type: | ProtectedTemplateTargetDiskType |
| Default value: | None |
| Accepted values: | MicrosoftWindows, PreprocessedLinux |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-TemplateName
Specifies the name of the template.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-Version
Specifies a value that uniquely identifies this version of the template. The version value uses the form a.b.c.d, where each value is an integer less than 65536.
Parameter properties
| Type: | Version |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Parameter properties
| Type: | SwitchParameter |
| Default value: | False |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | wi |
Parameter sets
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.
Related Links
Feedback
Was this page helpful?
