Skip to content

Commands

Simon edited this page May 26, 2022 · 4 revisions

Invoke-RoboCopy

Invoke-RoboCopy is the core function used by RobocopyPS and will contain all parameters that can be used with Robocopy.exe. Most, if not all, other functions will call Invoke-RoboCopy.

Copy items. Include subdirectories that is empty and create a log file at C:\tmp\log.log

Invoke-RoboCopy -Source C:\tmp\from\ -Destination C:\tmp\to\ -IncludeEmptySubDirectories -LogFile C:\tmp\log.log

Move all items. Note that this will remove C:\tmp\from\ when Robocopy is done

Invoke-RoboCopy -Source C:\tmp\from\ -Destination C:\tmp\to\ -MoveFilesAndDirectories

Copy-RoboItem

Copy one or more directories to a destination directory with the help of Invoke-RoboCopy.

Copy files and folders

Copy-RoboItem -Source "D:\tmp\from" -Destination "D:\tmp\to"