private/Get-SkylineFileName.ps1
Function Get-SkylineFileName { <# .SYNOPSIS Gets file name portion of an arbitrary local path .DESCRIPTION Gets file name portion of an arbitrary local path .EXAMPLE Get-SkylineFileName -Path "C:\Schemas\Documents.xml" .EXAMPLE Get-SkylineFileName -Path .\Schemas\Documents.xml .PARAMETER Path Path to get file name from #> [cmdletbinding()] param( [parameter(Mandatory = $True, ValueFromPipeline = $True)] [string]$Path ) Process { Write-Debug ( "Running $($MyInvocation.MyCommand).`n" + "PSBoundParameters:`n$($PSBoundParameters | Format-List | Out-String)") Try { return $Path.Substring($Path.LastIndexOf("\") + 1) } Catch { Throw $_ } } } |