Skip to content

Instantly share code, notes, and snippets.

@adbertram
Created June 18, 2024 15:53
Show Gist options
  • Save adbertram/ad098fc4f903f5f5f0fba1282096896b to your computer and use it in GitHub Desktop.
Save adbertram/ad098fc4f903f5f5f0fba1282096896b to your computer and use it in GitHub Desktop.
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