以Windows 2008 R2服務器上的管理員身份導航到C:\Users\%SomeUsername%
時,出現錯誤You don't currently have permission to access this folder
,Click Continue to permanently get access to this folder
。點擊Continue
可以解決這個問題。解決PowerShell中「您當前沒有權限訪問此文件夾」的問題
如果我嘗試使用PowerShell(例如get-childitem 'C:\Users\' -Directory | get-childitem -Force
;或其他變體),我還沒有向其授予訪問權限的任何配置文件明確給出錯誤Access to the path 'C:\Users\%SomeUsername%' is denied.
;即使包含了Force開關。
有沒有辦法通過PowerShell「點擊繼續」即讓系統允許我訪問任何我沒有嚴格訪問的內容,但是由於服務器上的管理員可以授予我訪問權限的權限。理想情況下,這可以在我訪問文件時完成(例如通過Get-Item
命令中的開關),而不必編寫代碼來明確檢查和修改權限。