IT:AD:Powershell:HowTo:Snippets:Work with FileNames
Summary
You probably could do it all with counters, etc…but why bother.
Just invoke the .NET class to do the heavy lifting.
Proccess
To get just the filename, without Extension:
function Get-FileName-WithoutExtension([string]$fileName){
#invoke the .NET object to do the heavy lifting:
$result = [System.IO.Path]:: GetFileNameWithoutExtension($fileName)
}