I have an absolute path in a variable in my powershell 2.0 script. I want to strip off the extension but keep the full path and file name. Easiest way to do that?
So
Regardless of whether $file is string or FileInfo object:
$file
string
FileInfo
(Get-Item $file).BaseName