Private/Get-pseLeafName.ps1
function Get-pseLeafName { [cmdletbinding()] param ( [parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [string[]]$filePath ) begin {} process { foreach ($path in $filePath) { $leafName = [System.IO.Path]::GetFileName($Path) [pscustomobject]@{ LeafName = $leafName } } } } |