0
我想將一堆子目錄中的文件移動到父目錄中。我已經證實,個人搜索有效,並且我的連接是正確的。然而,移動項目沒有任何東西。Move-Item不移動文件
我不明白爲什麼。
Get-ChildItem $pwd -name -recurse *.docx | foreach{ Move-Item (Join-Path . $_) .}
任何幫助,將不勝感激。
謝謝。
編輯:根據J.Drexler的解釋/回答更新我的問題特有的解決方案。
Get-ChildItem $pwd -name -recurse *.docx | Move-Item -Destination .
添加'-whatif'或'-verbose'您移動-Item命令來看看是怎麼回事上。 –
'Move-Item $ _。FullName。\' –
@Mathias R. Jessen:,Get-ChildItem的輸出是一個字符串。所以$ _。FullName將不起作用。 – abjbhat