ถ้าฉันใช้Get-ChildItem
เพื่อค้นหา C: \ ทั้งหมดไม่พบไฟล์ แต่ถ้าฉัน จำกัด มันไว้ที่ C: \ ProgramData \ a จะพบไฟล์ ทำไม?
เวอร์ชั่นสั้น
Get-ChildItem C:\ -Recurse -Filter curl-ca-bundle.crt
(ไม่พบอะไรเลย)
Get-ChildItem C:\ProgramData\ -Recurse -Filter curl-ca-bundle.crt
(ค้นหาC: \ ProgramData \ chocolatey \ lib \ curl \ tools \ curl-7.63.0-win64-mingw \ bin \ curl-ca-bundle.crt )
เวอร์ชันเต็ม
**********************
Windows PowerShell transcript start
Start time: 20181213133922
Username: ████████████████████████
RunAs User: ████████████████████████
Configuration Name:
Machine: ████████████████████████ (Microsoft Windows NT 10.0.17134.0)
Host Application: C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -nopro
Process ID: 16060
PSVersion: 5.1.17134.407
PSEdition: Desktop
PSCompatibleVersions: 1.0, 2.0, 3.0, 4.0, 5.0, 5.1.17134.407
BuildVersion: 10.0.17134.407
CLRVersion: 4.0.30319.42000
WSManStackVersion: 3.0
PSRemotingProtocolVersion: 2.3
SerializationVersion: 1.1.0.1
**********************
Transcript started, output file is find-curl-certs.log
PS C:\Users\brianl> Get-ChildItem -Path C:\ -Filter curl-ca-bundle.crt -Recurse
Get-ChildItem : Access to the path 'C:\Windows\CCM\ScriptStore' is denied.
At line:1 char:1
+ Get-ChildItem -Path C:\ -Filter curl-ca-bundle.crt -Recurse
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (C:\Windows\CCM\ScriptStore:String) [Get-ChildItem],
UnauthorizedAccessException
+ FullyQualifiedErrorId : DirUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetChildItemCommand
Get-ChildItem : Access to the path 'C:\Windows\CCM\ScriptStore' is denied.
At line:1 char:1
+ Get-ChildItem -Path C:\ -Filter curl-ca-bundle.crt -Recurse
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (C:\Windows\CCM\ScriptStore:String) [Get-ChildItem], Una
uthorizedAccessException
+ FullyQualifiedErrorId : DirUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetChildItemComma
nd
Get-ChildItem : Access to the path 'C:\Windows\CSC' is denied.
At line:1 char:1
+ Get-ChildItem -Path C:\ -Filter curl-ca-bundle.crt -Recurse
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (C:\Windows\CSC:String) [Get-ChildItem], UnauthorizedAccessException
+ FullyQualifiedErrorId : DirUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetChildItemCommand
Get-ChildItem : Access to the path 'C:\Windows\CSC' is denied.
At line:1 char:1
+ Get-ChildItem -Path C:\ -Filter curl-ca-bundle.crt -Recurse
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (C:\Windows\CSC:String) [Get-ChildItem], UnauthorizedAcc
essException
+ FullyQualifiedErrorId : DirUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetChildItemComma
nd
Get-ChildItem : Access to the path 'C:\Windows\System32\LogFiles\WMI\RtBackup' is denied.
At line:1 char:1
+ Get-ChildItem -Path C:\ -Filter curl-ca-bundle.crt -Recurse
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (C:\Windows\Syst...es\WMI\RtBackup:String) [Get-ChildItem],
UnauthorizedAccessException
+ FullyQualifiedErrorId : DirUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetChildItemCommand
Get-ChildItem : Access to the path 'C:\Windows\System32\LogFiles\WMI\RtBackup' is denied.
At line:1 char:1
+ Get-ChildItem -Path C:\ -Filter curl-ca-bundle.crt -Recurse
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (C:\Windows\Syst...es\WMI\RtBackup:String) [Get-ChildIte
m], UnauthorizedAccessException
+ FullyQualifiedErrorId : DirUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetChildItemComma
nd
PS C:\Users\brianl> Get-ChildItem -Path C:\ProgramData\ -Filter curl-ca-bundle.crt -Recurse
Directory: C:\ProgramData\chocolatey\lib\curl\tools\curl-7.63.0-win64-mingw\bin
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 12/13/2018 12:07 207949 curl-ca-bundle.crt
Get-ChildItem : Access to the path 'C:\ProgramData\Microsoft\Diagnosis\FeedbackHub' is denied.
At line:1 char:1
+ Get-ChildItem -Path C:\ProgramData\ -Filter curl-ca-bundle.crt -Recur ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (C:\ProgramData\...sis\FeedbackHub:String) [Get-ChildItem],
UnauthorizedAccessException
+ FullyQualifiedErrorId : DirUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetChildItemCommand
Get-ChildItem : Access to the path 'C:\ProgramData\Microsoft\Diagnosis\FeedbackHub' is denied.
At line:1 char:1
+ Get-ChildItem -Path C:\ProgramData\ -Filter curl-ca-bundle.crt -Recur ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (C:\ProgramData\...sis\FeedbackHub:String) [Get-ChildIte
m], UnauthorizedAccessException
+ FullyQualifiedErrorId : DirUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetChildItemComma
nd
Get-ChildItem : Access to the path 'C:\ProgramData\Microsoft\Diagnosis\TenantStorage\P-ARIA' is denied.
At line:1 char:1
+ Get-ChildItem -Path C:\ProgramData\ -Filter curl-ca-bundle.crt -Recur ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (C:\ProgramData\...tStorage\P-ARIA:String) [Get-ChildItem],
UnauthorizedAccessException
+ FullyQualifiedErrorId : DirUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetChildItemCommand
Get-ChildItem : Access to the path 'C:\ProgramData\Microsoft\Diagnosis\TenantStorage\P-ARIA' is denied.
At line:1 char:1
+ Get-ChildItem -Path C:\ProgramData\ -Filter curl-ca-bundle.crt -Recur ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (C:\ProgramData\...tStorage\P-ARIA:String) [Get-ChildIte
m], UnauthorizedAccessException
+ FullyQualifiedErrorId : DirUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetChildItemComma
nd
Get-ChildItem : Access to the path 'C:\ProgramData\Microsoft\Windows\SystemData' is denied.
At line:1 char:1
+ Get-ChildItem -Path C:\ProgramData\ -Filter curl-ca-bundle.crt -Recur ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (C:\ProgramData\...dows\SystemData:String) [Get-ChildItem],
UnauthorizedAccessException
+ FullyQualifiedErrorId : DirUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetChildItemCommand
Get-ChildItem : Access to the path 'C:\ProgramData\Microsoft\Windows\SystemData' is denied.
At line:1 char:1
+ Get-ChildItem -Path C:\ProgramData\ -Filter curl-ca-bundle.crt -Recur ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (C:\ProgramData\...dows\SystemData:String) [Get-ChildIte
m], UnauthorizedAccessException
+ FullyQualifiedErrorId : DirUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetChildItemComma
nd
Get-ChildItem : Access to the path 'C:\ProgramData\Microsoft\Windows Defender Advanced Threat Protection\Cache' is
denied.
At line:1 char:1
+ Get-ChildItem -Path C:\ProgramData\ -Filter curl-ca-bundle.crt -Recur ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (C:\ProgramData\...rotection\Cache:String) [Get-ChildItem],
UnauthorizedAccessException
+ FullyQualifiedErrorId : DirUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetChildItemCommand
Get-ChildItem : Access to the path 'C:\ProgramData\Microsoft\Windows Defender Advanced Threat
Protection\Cache' is denied.
At line:1 char:1
+ Get-ChildItem -Path C:\ProgramData\ -Filter curl-ca-bundle.crt -Recur ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (C:\ProgramData\...rotection\Cache:String) [Get-ChildIte
m], UnauthorizedAccessException
+ FullyQualifiedErrorId : DirUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetChildItemComma
nd
Get-ChildItem : Access to the path 'C:\ProgramData\Microsoft\Windows Defender Advanced Threat Protection\Cyber' is
denied.
At line:1 char:1
+ Get-ChildItem -Path C:\ProgramData\ -Filter curl-ca-bundle.crt -Recur ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (C:\ProgramData\...rotection\Cyber:String) [Get-ChildItem],
UnauthorizedAccessException
+ FullyQualifiedErrorId : DirUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetChildItemCommand
Get-ChildItem : Access to the path 'C:\ProgramData\Microsoft\Windows Defender Advanced Threat
Protection\Cyber' is denied.
At line:1 char:1
+ Get-ChildItem -Path C:\ProgramData\ -Filter curl-ca-bundle.crt -Recur ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (C:\ProgramData\...rotection\Cyber:String) [Get-ChildIte
m], UnauthorizedAccessException
+ FullyQualifiedErrorId : DirUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetChildItemComma
nd
Get-ChildItem : Access to the path 'C:\ProgramData\Microsoft\Windows Defender Advanced Threat Protection\Trace' is
denied.
At line:1 char:1
+ Get-ChildItem -Path C:\ProgramData\ -Filter curl-ca-bundle.crt -Recur ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (C:\ProgramData\...rotection\Trace:String) [Get-ChildItem],
UnauthorizedAccessException
+ FullyQualifiedErrorId : DirUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetChildItemCommand
Get-ChildItem : Access to the path 'C:\ProgramData\Microsoft\Windows Defender Advanced Threat
Protection\Trace' is denied.
At line:1 char:1
+ Get-ChildItem -Path C:\ProgramData\ -Filter curl-ca-bundle.crt -Recur ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (C:\ProgramData\...rotection\Trace:String) [Get-ChildIte
m], UnauthorizedAccessException
+ FullyQualifiedErrorId : DirUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetChildItemComma
nd
PS C:\Users\brianl> $PSDefaultParameterValues
PS C:\Users\brianl> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.17134.407
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17134.407
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
PS C:\Users\brianl> (Get-Command Get-ChildItem).Module
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Manifest 3.1.0.0 Microsoft.PowerShell.Management {Add-Computer, Add-Content, Checkpoint-Compu...
PS C:\Users\brianl> (Get-PSProvider FileSystem).ImplementingType.Assembly.FullName
System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
PS C:\Users\brianl> Stop-Transcript
**********************
Windows PowerShell transcript end
End time: 20181213135005
**********************
@PimpJuiceIT นี่ทำงานเป็นผู้ดูแลระบบอยู่แล้ว โฟลเดอร์ที่มีข้อผิดพลาดเกี่ยวกับการอนุญาตไม่ใช่โฟลเดอร์ที่มีไฟล์ นี้จะยังไม่ได้อธิบายว่าทำไมเริ่มต้นที่ต่ำกว่าในต้นไม้ผลงาน
—
อธิการที่
ฉันขอโทษ แต่ข้อผิดพลาดระบุสองสิ่ง .... "สิทธิ์ใช้งาน" และ "DirUnauthorizedAccessError" ดังนั้นสำหรับฉันดูเหมือนว่าปัญหาการอนุญาตการเข้าถึง
—
Pimp Juice IT
@PimpJuiceIT คุณเห็นว่าไฟล์อยู่ภายใต้C: \ ProgramData \ chocolateyใช่ไหมไม่ใช่โฟลเดอร์ที่มีข้อผิดพลาดใช่ไหม? ฉันสามารถระงับข้อผิดพลาดเหล่านั้นด้วย
—
อธิการที่
-Exclude
แน่นอน แต่คุณจะได้รับการแขวนกับข้อผิดพลาดที่ไม่เกี่ยวข้องจริงๆ
(ถอดอย่างน้อยหนึ่ง "สิทธิ" ร่างของฉันถูกตีพิมพ์และฉันถูกดึงออกไปทันที)
—
brianary