The Set-SCVirtualHardDiskConfiguration cmdlet modifies the virtual hard disk configuration information that is contained within a virtual machine configuration.
Examples
Example 1: Set the properties of a virtual hard disk configuration
The first command gets the service configuration object named Service01 and stores the object in the $ServiceConfig variable.
The second command gets the computer tier configuration for the service configuration object stored in $ServiceConfig and stores the object in the $TierConfig variable.
The third command gets the virtual machine configuration for the computer tier configuration stored in $TierConfig and stores the object in the $VMConfig variable.
The fourth command gets the virtual hard disk configuration for the first virtual machine configuration stored in $VMConfig and stores the object in the $VHDConfig variable.
The fifth command gets the virtual hard disk object named Win2k8R2BaseDisk.vhd from the library and stores the object in the $VHD variable.
The last command updates the PinSourceLocation property in the virtual hard disk configuration stored in $VHDConfig for the source virtual hard disk stored in $VHD to pin the value of the source virtual hard disk, thereby preventing it from being changed during placement.
Parameters
-DeploymentOption
Specifies the deployment option for a virtual hard disk.
The acceptable values for this parameter are:
Specifies the destination path for or on a virtual hard disk.
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:
False
Value from remaining arguments:
False
-FileInjectionDestinationLocation
Specifies the target folder path (relative path to the root of the partition) where the source file(s) are injected into the selected VHD before turning on the virtual machine for the first time.
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:
False
Value from remaining arguments:
False
-FileInjectionDestinationPartition
Specifies the target partition of the selected VHD where the source files are injected before turning on the virtual machine for the first time.
Parameter properties
Type:
Int16
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:
False
Value from remaining arguments:
False
-FileInjectionSourceLocation
Specifies the location (an URL) of the file(s) to inject into the virtual machine before turning on the virtual machine for the first time.
When a folder is specified, all files under that folder are injected into the specified destination location.
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:
False
Value from remaining arguments:
False
-FileName
Specifies the file name to use when you rename a virtual hard disk file as you add it to a virtual machine.
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:
False
Value from remaining arguments:
False
-JobVariable
Specifies that job progress is tracked and stored in the variable named by this parameter.
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:
False
Value from remaining arguments:
False
-ParentVirtualHardDiskDestinationPath
Specifies the destination path for parent virtual hard disk.
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:
False
Value from remaining arguments:
False
-ParentVirtualHardDiskPath
Specifies the path to the parent virtual hard disk to be used when creating a differencing disk.
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:
False
Value from remaining arguments:
False
-PinDestinationLocation
Indicates whether the destination location chosen by the user is retained during service deployment configuration.
Parameter properties
Type:
Boolean
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:
False
Value from remaining arguments:
False
-PinFileName
Indicates whether the file name chosen by the user is retained during service deployment configuration.
Parameter properties
Type:
Boolean
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:
False
Value from remaining arguments:
False
-PinSourceLocation
Indicates whether the source location chosen by the user is retained during service deployment configuration.
Parameter properties
Type:
Boolean
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:
False
Value from remaining arguments:
False
-PinStorageDisk
Indicates whether the storage disk chosen by the user is retained during service deployment configuration.
Parameter properties
Type:
Boolean
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:
False
Value from remaining arguments:
False
-PROTipID
Specifies the ID of the Performance and Resource Optimization tip (PRO tip) that triggered this action.
This parameter lets you audit PRO tips.
Parameter properties
Type:
Guid
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:
False
Value from remaining arguments:
False
-RunAsynchronously
Indicates that the job runs asynchronously so that control returns to the command shell immediately.
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:
False
Value from remaining arguments:
False
-SourceDisk
Specifies the source virtual hard disk.
Parameter properties
Type:
StandaloneVirtualHardDisk
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:
False
Value from remaining arguments:
False
-StorageClassification
Specifies a storage classification object.
Parameter properties
Type:
StorageClassification
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:
False
Value from remaining arguments:
False
-StorageDisk
Specifies a disk on a Hyper-V or VMware ESX host that a virtual machine on that host can use instead of using a virtual hard disk.
This disk is referred to as a pass-through disk.
The corresponding VMware term is Raw Device Mapping (RDM).
The host disk is either a local hard disk or a logical unit on a Storage Area Network (SAN).
VMM lets the virtual machine bypass the host's file system and access the pass-through disk directly.
Hyper-V hosts support pass-through disks and conversion of a pass-through disk to a VHD.
VMware ESX hosts support pass-through disks, but not disk conversion.
Citrix XenServer hosts do not support pass-through disks.
Parameter properties
Type:
StorageDisk
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:
False
Value from remaining arguments:
False
-StorageQoSPolicy
Specifies a StorageQoSPolicy object.
Parameter properties
Type:
StorageQoSPolicy
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:
False
Value from remaining arguments:
False
-VHDConfiguration
Specifies a virtual hard disk configuration object.
Parameter properties
Type:
VirtualHardDiskConfiguration
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
True
Value from pipeline:
True
Value from pipeline by property name:
False
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
VirtualHardDiskConfiguration
This cmdlet returns a VirtualHardDiskConfiguration object.