In a previous tip we showed that Trim() is an unsafe way for removing file extensions. A safe way uses .NET methods:
[system.io.path]::GetFileNameWithoutExtension('c:\test\report.txt') Report
In a previous tip we showed that Trim() is an unsafe way for removing file extensions. A safe way uses .NET methods:
[system.io.path]::GetFileNameWithoutExtension('c:\test\report.txt') Report