powershell - 批量文件重命名 - PowerShell

标签 powershell

很难说出这里问的是什么。这个问题是模棱两可的、含糊的、不完整的、过于宽泛或修辞的,不能以其目前的形式得到合理的回答。如需帮助澄清此问题以便可以重新打开,visit the help center .




10 年前关闭。




我在这个格式的文件夹中有很多文件

constant_blah_blah_blah.png

如何用空格替换下划线并使用 PowerShell 从中删除 constant_?

提前致谢。

最佳答案

你可以试试这个

Get-childItem constant* | % {rename-item $_.name ($_.name -replace '_',' ')}
Get-childItem constant* | % {rename-item $_.name ($_.name -replace 'constant ','')}

关于powershell - 批量文件重命名 - PowerShell,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8126970/

相关文章:

powershell - Get-AzureStorageBlob 抛出找不到您的 azure 存储凭据

performance - 读取CSV文件时Powershell拦截并修复特定值

powershell - 有没有一种方法可以显示使用PowerShell满足条件的文本行

powershell - 编辑 Windows 任务计划程序任务的触发器

powershell - 将 CSV 内容添加到另一个 CSV

c# - "Enable Always on support..."用于通过 C# 或 powershell 的 SSIS

powershell - 使用psake,exec和msbuild时如何正确转义目录?

Powershell查找并替换注册表值?

shell - Jenkins Pipeline Access 阶段步骤变量在 powershell 执行中

当我手动输入命令时,Powershell 脚本运行良好,但在使用 PDQ Deploy 部署时失败