Skip to content

xVhdFile

dscbot edited this page Jun 4, 2022 · 1 revision

xVhdFile

Parameters

Parameter Attribute DataType Description Allowed Values
VhdPath Key String Path to the VHD
FileDirectory Required MSFT_xFileDirectory[] The FileDirectory objects to copy to the VHD
CheckSum Write String ModifiedDate, SHA-1, SHA-256, SHA-512

MSFT_xFileDirectory

Parameters

Parameter Attribute DataType Description Allowed Values
DestinationPath Required String
SourcePath Write String
Ensure Write String Present, Absent
Type Write String File, Directory
Recurse Write Boolean
Force Write Boolean
Content Write String
Attributes Write StringArray[] ReadOnly, Hidden, System, Archive

Description

Manages files or directories in a VHD.

You can use it to copy files/folders to the VHD, remove files/folders from a VHD, and change attributes of a file in a VHD (e.g. change a file attribute to 'ReadOnly' or 'Hidden'). This resource is particularly useful when bootstrapping DSC Configurations into a VM.

Requirements

  • The Hyper-V Role has to be installed on the machine.
  • The Hyper-V PowerShell module has to be installed on the machine.