Created
June 18, 2024 15:53
-
-
Save adbertram/ad098fc4f903f5f5f0fba1282096896b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-ListOfFiles { | |
[OutputType('System.IO.FileInfo')] | |
[CmdletBinding()] | |
param( | |
[string]$Path | |
) | |
Get-ChildItem -File -Path $Path | |
} | |
Get-ListOfFiles -Path "C:\Temp" | ForEach-Object { | |
$_. <hit tab and it will show you all properties since it knows it's a FileInfo object> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment