This project has moved. For the latest updates, please go here.

Getting error: Get-ChildItem : A parameter cannot be found that matches parameter name 'File'.



Thank you for providing this utility. I am new to SP and I hope this will make the installation process smoother.

I am running AutoSPSourceBuilder on a Windows 2008 server. Is it possible that Powershell is too old and needs to be upgraded?



ardong wrote Jun 9, 2014 at 8:50 PM

Sorry, here is the full error text:

Get-ChildItem : A parameter cannot be found that matches parameter name 'File'.
At M:\SP media\AutoSPSourceBuilder.ps1:213 char:43
  • ForEach ($item in (Get-ChildItem -File <<<< -Path $Path -Recurse -ErrorAction SilentlyContinue))
    • CategoryInfo : InvalidArgument: (:) [Get-ChildItem], ParameterBindingException
    • FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand

brianlala wrote Jun 12, 2014 at 3:17 PM

Yes, you need a newer version of PowerShell it seems. Looks like the Get-ChildItem cmdlet was updated to include that newer parameter "-File".


mcnga1 wrote Jul 19, 2014 at 2:00 AM

I am having same issue as ardong, using PowerShell 2.0.

Per the documentation for PowerShell 4.0, there is no "-File" option for Get-ChildItem.

Are you certain about the need for a "newer version?"

mcnga1 wrote Jul 19, 2014 at 2:06 AM

Razman007 wrote Feb 20, 2015 at 1:17 PM

All I did to resolve this problem was to save my work close the PowerShell ISE and re-open the file. When I did this the error message was no longer showing up.