I know that we can use the parameter -File in Powershell V3.0 but how can we get only files with the Get-childitem cmdlet in Powershell V2 ?
You could use the Where-Object cmdlet to check the PSIsContainer
property:
Get-ChildItem | Where-Object { !$_.PSIsContainer }