【发布时间】:2015-02-09 03:06:36
【问题描述】:
我想将 .rpt 文件从 dr_network 重命名为 dr_network_10yr。然后创建文件夹Output(如果不存在)并将文件移动到文件夹中。
文件的重命名有效,但无法移动文件。注意文件应该是相对路径。
感谢您的帮助。
New-Item .\Output -force
Get-ChildItem *.rpt |
ForEach-Object{
Rename-Item $_ ($_.Name -replace 'dr_network_','dr_network_10yr')
Move-Item $_($_.Fullname -destination ".\Output")
}
【问题讨论】:
标签: powershell