Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions DSCResources/MSFT_xRobocopy/MSFT_xRobocopy.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function Get-TargetResource
[System.String]
$Destination,

[System.String]
[System.String[]]
$Files,

[System.UInt32]
Expand Down Expand Up @@ -82,7 +82,7 @@ function Set-TargetResource
[System.String]
$Destination,

[System.String]
[System.String[]]
$Files,

[System.UInt32]
Expand Down Expand Up @@ -137,7 +137,7 @@ function Test-TargetResource
[System.String]
$Destination,

[System.String]
[System.String[]]
$Files,

[System.UInt32]
Expand Down Expand Up @@ -218,7 +218,7 @@ function Get-RobocopyArguments
[System.String]
$Destination,

[System.String]
[System.String[]]
$Files,

[System.UInt32]
Expand Down
3 changes: 1 addition & 2 deletions DSCResources/MSFT_xRobocopy/MSFT_xRobocopy.schema.mof
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class MSFT_xRobocopy : OMI_BaseResource
{
[Key, Description("Source Directory, Drive or UNC path.")] String Source;
[Key, Description("Destination Dir, Drive or UNC path.")] String Destination;
[Write, Description("File(s) to copy (names/wildcards: default is all files).")] String Files;
[Write, Description("File(s) to copy (names/wildcards: default is all files).")] String Files[];
[Write, Description("Number of Retries on failed copies: default 1 million.")] UInt32 Retry;
[Write, Description("Wait time between retries: default is 30 seconds.")] UInt32 Wait;
[Write, Description("Copy subdirectories, including Empty ones.")] Boolean SubdirectoriesIncludingEmpty;
Expand All @@ -15,4 +15,3 @@ class MSFT_xRobocopy : OMI_BaseResource
[Write, Description("Robocopy has MANY configuration options. Too many to present them all as DSC parameters effectively. Use this option to set additional parameters. Each parameter should be a separate array member. This array will be combined with main argument array. For a list of options run Robocopy /??? in a shell window.")] String AdditionalArgs[];
[Read, ValueMap{"Present", "Absent"}, Values{"Present", "Absent"}, Description("Will indicate whether Destination is in sync with Source")] String Ensure;
};

8 changes: 8 additions & 0 deletions Examples/xRobocopy.SimpleCopyOptions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ configuration RobocopyExample
Files = '*.sql'
}

#this will copy only specified files in source directory
xRobocopy CopyByUsingFilesFilter
{
Source = 'C:\temp\source'
Destination = 'C:\temp\destination'
Files = @('test1.txt', 'test2.txt')
}

#this is equivalent of using /e option
xRobocopy CopyFilesAndSubfolders
{
Expand Down