powershell-重命名文件并移动
作者:互联网
重命名文件并移动
例如文件jinwei.txt先修改为jinwei+随机码.txt(例如:jinwei23.txt)
然后Move到to路径
$from="\\10.XX.XX\from\*.*"
$to="C:\to\"
$a =get-random -maximum 100
$a =[string]$a+".TXT"
Get-ChildItem -Path $from |
Rename-Item -NewName {$_.Name -replace ".txt",$a} -PassThru |
Move-Item -Destination $to -Force
标签:重命名,移动,Move,Item,XX,jinwei,txt,powershell 来源: https://www.cnblogs.com/JinweiChang/p/15098373.html