PowerShell 中 Get-ChildItem 的 -Force 参数有什么用?
要连同隐藏文件一起显示文件,您需要使用 -Force 参数。
命令
Get-ChildItem D:\Temp\ -Force
输出

如果您看到以上输出,那么 hiddenfile.xlsx 是隐藏文件,可以使用文件模式的 -a-h— 属性来识别。
您还可以在 -Recurse 或 -Depth 参数中使用此参数。
Get-ChildItem D:\Temp\ -Recurse -Force
广告
要连同隐藏文件一起显示文件,您需要使用 -Force 参数。
Get-ChildItem D:\Temp\ -Force

如果您看到以上输出,那么 hiddenfile.xlsx 是隐藏文件,可以使用文件模式的 -a-h— 属性来识别。
您还可以在 -Recurse 或 -Depth 参数中使用此参数。
Get-ChildItem D:\Temp\ -Recurse -Force