I'm doing a lot of System.IO.Path operations and I was curious if it was possible to store reference to that static class in a variable so it is shorter?
Instead of writing these long winded namespace.class paths:
[System.IO.Path]::Combine([System.IO.Path]::GetDirectoryName($targetFile), [System.IO.Path]::GetFileName("newfile_$targetFile"))
It would be great to write this:
$path = [System.IO.Path]
$path.Combine($path.GetDirectoryName($targetFile), $path.GetFileName("newfile_$targetFile"))
Is there a way to do this in powershell?