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 }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With