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
You should use the simple .NET framework method, instead of cobbling together path parts or doing replacements.
PS> [System.IO.Path]::GetFileNameWithoutExtension($file)
https://msdn.microsoft.com/en-us/library/system.io.path.getfilenamewithoutextension%28v=vs.110%29.aspx