Desired State Configuration (DSC) – Configuration snippet – File Resource – Create / Copy files

Create Directory

        File DirectoryCreate1
        {
            Ensure = "Present"
            Type = "Directory"
            #Recurse = $true
            DestinationPath = "E:\Hyper-V"
        }

Copy Directory

 File CopyFoldersISOs
 {
 DestinationPath = "D:\Hyper-V\ISO"
 SourcePath = "\\opserver04\Data\Install\ISOs\HyperBuild"
 Ensure = "Present"
 Type = "Directory"
 Recurse = $true
 Force = $true
 MatchSource = $true
 DependsOn = '[File]DirectoryCreate1'
 }
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s