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