且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Powershell中递归重命名文件

更新时间:2023-11-22 22:49:10

我认为你需要 foreach-object:

I think you need foreach-object:

get-childitem -recurse ./ *NYCSCA* |  where-object { $_.Name -like
 "*NYCSCA*" } | % {rename-item $_ -newname $_.Name.Replace(" ","_") -whatif}

无法将管道数组重命名为集合.

The piped array can't be renamed as a set.