After some googling, majority of posts online talking about the goods of PowerShell, and the environment going to use robocopy is Windows Server 2016. Thus, an original batch file with two command lines is to be converted to its PowerShell version.
What are the things to be careful of in order to convert the batch version of robocopy to PowerShell version? Since PowerShell is quite new and from scratch. Is there any PowerShell version difference like ps ver1 ver2 ver3? Anything could be benefited if using PowerShell or enhanced?
What is the /b mode for? Microsoft official site seems not providing the details well....
The batch command is like below:
//get the locale independent time
FOR /F %%A IN ('WMIC OS GET LocalDateTime ^| FINDSTR \.') DO @SET D=%%A
//unluckily could not find details of /b backup option to find out what is /b mode working for?
robocopy X:\dat Y:\dat /v /xo /xa:sh /xj /unicode /mov /b /r:1 /w:1 /LOG+:C:\log\%D:~0,4%%D:~4,2%%D:~6,2%.log /xd "$RECYCLE.BIN" "System Volume Information"
/b
copies files in backup mode. You can find information onrobocopy
's switches by runningrobocopy /?
. What do you mean by "powershell is [...] from scratch"?