I'm trying to copy some files from one diretory to another, check if exists and replace name if yes. And copy all files.
But it gives me the above message:
cmdlet Copy-Item at command pipeline position 1
Supply values for the following parameters:
Path[0]:
PS C:\Scripts\MetadataExport>
What i'm doing wrong?
My code:
Get-ChildItem -Path "C:\Scripts\MetadataExport\*\*" -Directory | ForEach-Object {
$_.FullName | ForEach-Object {Get-ChildItem $_ *.opex | ForEach-Object{If([System.IO.File]::Exists("C:\Scripts\MetadataExport\$Bundles")){While($true){$i=0
$i++
$_.Name= $_+$i}
}Else{Copy-Item -Destination "C:\Scripts\MetadataExport\$Bundles" }}
Get-ChildItem $_ -Recurse -Include *.xip | ForEach-Object{If([System.IO.File]::Exists("C:\Scripts\MetadataExport\$Bundles")){While($true){$i=0
$i++
$_.Name= $_+$i}
}Else{Copy-Item -Destination "C:\Scripts\MetadataExport\$Resources"}}
}
}
Thanks for any help on this
Copy-Itemwhat to copy ... [grin]