$from = ".\test\Application Data\software1\config\1.0"
$to = ".\test\Profile2k8\Appdata"
$exclude = @("new.ini","new2.ini")
Get-ChildItem $from -Recurse -Exclude $exclude | Copy-Item -Destination {Join-Path $to $_.FullName.Substring($from.length)}
當我運行此腳本,它將複製文件,但它也包括在目標路徑中像這樣的數據文件夾:爲什麼這個文件夾是PowerShell的複製遞歸創建一個數據文件夾
.\test\Profile2k8\Appdata\n Data\software1\config\1.0
創建,我怎樣才能防止這一點?
感謝這麼多提前
現在,它只是複製的 內容\測試\應用數據中\軟件1 \ CONFIG \ 1.0 直接: 。\ test \ Profile2k8 \ Appdata 沒有創建軟件\ config \ 1.0文件夾 – Klausmaus 2015-02-10 08:17:27
你的意思是說遞歸heirarchy不會出現在目標文件夾中嗎? – RinoTom 2015-02-10 08:26:08
yes/no來自「。\ test \ Application Data \ software1 \ config \ 1.0」 下面的所有文件夾正在創建,但\ software1 \ config \ 1.0部分不是 – Klausmaus 2015-02-10 08:34:40