powershell - Copying a item without waiting -


i want copy package on network, of several gb , cant copying completed continue executing ps script , remaining tasks, not dependent. best way this?

currently think best way call script execute copy no wait. thoughts appreciated.

powershell has lot of options that. 1 simplest approach use copy psjob like:

#put script here want before copying $source_path = "\\path\to\source\file" $destination_path = "path\to\destination\file" start-job -scriptblock {param($source_path,$destination_path) copy-item $source_path $destination_path} -argumentlist $source_path,$destination_path  # keep remaining script here  

or can

$copyjob = start-job –scriptblock {      $source = "\\path\to\source\file"      $target = "path\to\destination\file"       copy-item -path $source -destination $target -recurse verbose   }  

you can use background intelligent transfer service (bits) cmdlets need have module present, should

import-module bitstransfer 

Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -