繁体   English   中英

PowerShell Output 文本文件的特定扩展名的文件名

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM