PS> $pshome
C:\Windows\System32\WindowsPowerShell\v1.0
PS> [WindowsAPILib.Helper]::CompactPath($pshome, 12)
C:\W...\v1.0
PS> [WindowsAPILib.Helper]::CompactPath($pshome, 18)
C:\Windows...\v1.0
PS> [WindowsAPILib.Helper]::CompactPath($pshome, 22)
C:\Windows\Sys...\v1.0