Horrendous day with TeamCity and PowerShell ends with
NamedParameterNotFound
Get-ChildItem : A parameter cannot be found that matches parameter name 'File'.
$files = Get-ChildItem -Path $RootFolderPath -Filter $CodeFilename -File -Recurse
The offending line (above, bottom) is in a PS1 being ran by TeamCity.
The script runs beautifully on my local dev machine and the PS version on TC server is 4.0 apparently, and I can see the -File
param in a PS command window on the TC server itself.
How on Earth can the -File
parameter be missing from Get-ChildItem
??