Get-ChildItem : A parameter cannot be found that matches parameter name 'file
Technical87 opened this issue · 1 comments
Technical87 commented
When I run search-text -filepattern *.doc,*.docx,*.xlsx,*.pdf,*.xls -path "y:\" test
in Windows 10 or Server 2016 (both in powershell) I get the following error:
`Get-ChildItem : A parameter cannot be found that matches parameter name 'file'.
At C:\Program Files\WindowsPowerShell\Modules\PsSearch\1.0\PsSearch.psm1:145 char:40
-
$file = (Get-ChildItem @gcArgs -file -ea silent)
-
~~~~~
- CategoryInfo : InvalidArgument: (:) [Get-ChildItem], ParameterBindingException
- FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand`
Technical87 commented
Figured this one out, it throws the error if you run powershell as an admin. Just run it as normal by double clicking.