How to Get a File Extension in PowerShell (and the Name Without It)
Every file object PowerShell hands you already knows its extension. Read the Extension property to get the file extension, and BaseName for the file name without the extension: For a path that’s only text, [System.IO.Path]::GetExtension() and GetFileNameWithoutExtension() do the same job without touching the disk. In this tutorial, I’ll show you how to get a … Read more