![](/img/trans.png)
[英]Need a powershell script to read and fetch filenames from a text file
[英]PowerShell Output Filenames of a Specific Extension to a Text File
目前,我正在使用以下命令将 output 文件名转换为文本文件:
( Get-ChildItem -File ).BaseName | Out-File "Track List.txt" -Encoding utf8
如何将文件名限制为特定扩展名,例如 .mp3?
-Filter 参数接受通配符 -? 用于任何单个字符,* 用于零个或多个匹配项
( Get-ChildItem -File -Filter *.mp3).BaseName | Out-File "Track List.txt" -Encoding utf8
有关更多信息 [通配符],请参阅有关 -Filter 和通配符的Powershell文档:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.