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 = {
27param (
38 [string ]$fqdn ,
49 [string ]$sourcePath ,
@@ -101,7 +106,12 @@ param (
101106
102107 function Clean-Target
103108 {
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+ }
105115 $guid = [GUID ]::NewGuid()
106116 $tempDirectory = " $scriptRoot \temp$guid "
107117 New-Item - ItemType Directory - Force - Path $tempDirectory
@@ -128,7 +138,12 @@ param (
128138 [switch ]$fileCopy
129139 )
130140 {
131- $robocopyParameters = " /COPY:DAT "
141+ if (-not $ModifyRoboCopyRetries ){
142+ $robocopyParameters = " /COPY:DAT "
143+ }
144+ else {
145+ $robocopyParameters = " /COPY:DAT /R:3 "
146+ }
132147
133148 if (-not $fileCopy.IsPresent )
134149 {
Original file line number Diff line number Diff line change 1313 "author" : " Microsoft Corporation" ,
1414 "version" : {
1515 "Major" : 2 ,
16- "Minor" : 242 ,
16+ "Minor" : 251 ,
1717 "Patch" : 0
1818 },
1919 "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 1313 "author" : " Microsoft Corporation" ,
1414 "version" : {
1515 "Major" : 2 ,
16- "Minor" : 242 ,
16+ "Minor" : 251 ,
1717 "Patch" : 0
1818 },
1919 "releaseNotes" : " ms-resource:loc.releaseNotes" ,
You can’t perform that action at this time.
0 commit comments