Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Copy Certain folders from text file and NTFS permissons

$
0
0

I have the following code that I have found and manipulated some. I am looking to add an option to also copy all of the ntfs permissions as well. Any ideas on what I need to change of adapt would be great. Thanks.

 

$baseDir = "C:\NEW"
$targetDir = "C:\COPY"
$toCopyPath = "c:\scripts\tocopy.txt"

$toCopy = Get-Content $toCopyPath

$toCopy | ForEach-Object {
  Copy-Item "$baseDir\$_" $targetDir -Recurse -Force
}


Viewing all articles
Browse latest Browse all 6937

Trending Articles