PowerShell 中 Get-ChildItem 的 -Force 参数有什么用?


要连同隐藏文件一起显示文件,您需要使用 -Force 参数。

命令

Get-ChildItem D:\Temp\ -Force

输出

如果您看到以上输出,那么 hiddenfile.xlsx 是隐藏文件,可以使用文件模式的 -a-h— 属性来识别。

您还可以在 -Recurse 或 -Depth 参数中使用此参数。

Get-ChildItem D:\Temp\ -Recurse -Force

更新于: 23-Jan-2020

744 次浏览

开启您的职业生涯

完成课程获得认证

开始
广告
© . All rights reserved.