File tree Expand file tree Collapse file tree 3 files changed +20
-5
lines changed
Tasks/WindowsMachineFileCopyV2 Expand file tree Collapse file tree 3 files changed +20
-5
lines changed Original file line number Diff line number Diff line change 1
- $CopyJob = {
1
+ $featureFlags = @ {
2
+ ModifyNumberOfRetriesInRobocopy = [System.Convert ]::ToBoolean($env: MODIFY_NUMBER_OF_RETRIES_IN_ROBOCOPY )
3
+ }
4
+ $ModifyRoboCopyRetries = $featureFlags.ModifyNumberOfRetriesInRobocopy
5
+
6
+ $CopyJob = {
2
7
param (
3
8
[string ]$fqdn ,
4
9
[string ]$sourcePath ,
@@ -101,7 +106,12 @@ param (
101
106
102
107
function Clean-Target
103
108
{
104
- $cleanupArgument = " /NOCOPY /E /PURGE"
109
+ if (-not $ModifyRoboCopyRetries ){
110
+ $cleanupArgument = " /NOCOPY /E /PURGE"
111
+ }
112
+ else {
113
+ $cleanupArgument = " /NOCOPY /E /PURGE /R:3 "
114
+ }
105
115
$guid = [GUID ]::NewGuid()
106
116
$tempDirectory = " $scriptRoot \temp$guid "
107
117
New-Item - ItemType Directory - Force - Path $tempDirectory
@@ -128,7 +138,12 @@ param (
128
138
[switch ]$fileCopy
129
139
)
130
140
{
131
- $robocopyParameters = " /COPY:DAT "
141
+ if (-not $ModifyRoboCopyRetries ){
142
+ $robocopyParameters = " /COPY:DAT "
143
+ }
144
+ else {
145
+ $robocopyParameters = " /COPY:DAT /R:3 "
146
+ }
132
147
133
148
if (-not $fileCopy.IsPresent )
134
149
{
Original file line number Diff line number Diff line change 13
13
"author" : " Microsoft Corporation" ,
14
14
"version" : {
15
15
"Major" : 2 ,
16
- "Minor" : 242 ,
16
+ "Minor" : 251 ,
17
17
"Patch" : 0
18
18
},
19
19
"releaseNotes" : " What's new in Version 2.0: <br/> Proxy support is being added. <br/> Removed support of legacy DTL machines." ,
Original file line number Diff line number Diff line change 13
13
"author" : " Microsoft Corporation" ,
14
14
"version" : {
15
15
"Major" : 2 ,
16
- "Minor" : 242 ,
16
+ "Minor" : 251 ,
17
17
"Patch" : 0
18
18
},
19
19
"releaseNotes" : " ms-resource:loc.releaseNotes" ,
You can’t perform that action at this time.
0 commit comments