Want to wait till copy complete using Powershell Copy-Item Want to wait till copy complete using Powershell Copy-Item powershell powershell

Want to wait till copy complete using Powershell Copy-Item


Maybe "copy-item [...] | out-null" will help to wait for completion.

"Out-null actually deletes output instead of routing it to the PowerShell console, so the script will sit and wait for the content to be deleted before moving on."

The explanation comes from ITProToday.com: https://www.itprotoday.com/powershell/forcing-powershell-wait-process-complete


Copy-Item does block. I just copied a 4.2GB file from a share on our gigabit network to my local machine. My PowerShell prompt hung and didn't return for several minutes.


It seems like it's non-blocking here for very small files. I'm using:

Start-Sleep -s 3

To wait for the files to be copied. Not an ideal solution but it's what I got so far.