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.