PoshCode Archive  Artifact [e1f75344b8]

Artifact e1f75344b89a41d7215567890ed56d875d82f2ad0b2678f8540762b1c867c794:

  • File Coping-Files.ps1 — part of check-in [b45d6938ed] at 2018-06-10 14:03:32 on branch trunk — Copy Data between Folders including a Progressbar (user: zorion size: 713)

# encoding: ascii
# api: powershell
# title: Coping Files ...
# description: Copy Data between Folders including a Progressbar
# version: 0.1
# type: function
# author: zorion
# license: CC0
# function: copy-data
# x-poshcode-id: 5889
# x-archived: 2015-06-15T00:54:05
# x-published: 2015-06-10T11:10:00
#
#
function copy-data {
	param($source, $dest)
	$counter = 0
	$files = Get-ChildItem $source -Force -Recurse
	foreach($file in $files)
		{
		$status = "Copying file {0} of {1}: {2}" -f $counter, $files.count, $file.name
		Write-Progress -Activity "Copyng Files" -Status $status -PercentComplete ($counter/$files.count * 100)
		Copy-Item $file.pspath $dest -Force
		$counter++
		}
}