I have the following script
$sourceRoot = "C:\Users\skywalker\Desktop\deathStar\server"
$destinationRoot = "C:\Users\skywalker\Desktop\deathStar/server-sandbox"
$dir = get-childitem $sourceRoot -Exclude .env, web.config
Write-Output "Copying Folders"
$i=1
$dir| %{
[int]$percent = $i / $dir.count * 100
Write-Progress -Activity "Copying ... ($percent %)" -status $_ -PercentComplete $percent -verbose
copy -Destination $destinationRoot -Recurse -Force
$i++
I tried to reference this post, but I ended up getting the following prompt in the powershell console.
Supply values for the following parameters:
Path[0]:
copy -Destinationline since you have that INSIDE aForEach-Objectblock ... and didn't pass any source to it.