如何在PowerShell中以8.3标记显示目录列表?
您可以使用WMI:
Get-ChildItem | ForEach-Object{
$class = if($_.PSIsContainer) {"Win32_Directory"} else {"CIM_DataFile"}
Get-WMIObject $class -Filter "Name = '$($_.FullName -replace '\\','\\')'" | Select-Object -ExpandProperty EightDotThreeFileName
}
如果安装PSCX模块,则具有Get-ShortPath
cmdlet,可以执行以下操作:
您引起我的注意,这不是完整的答案,而是我为您提供帮助的方式:
您可以运行cmd ...