Functions/Open-InExplorer.ps1
function Open-InExplorer { [CmdletBinding()] param ( [Parameter()] [string] $Path = "." ) Write-Verbose $Path $NewPath = (Resolve-Path $Path).Path Write-Verbose $NewPath if (Test-Path $NewPath) { if($NewPath[$NewPath.Length - 1] -eq "\") { $NewPath2 = $NewPath.Substring(0, ($NewPath.Length - 1)) } else { $NewPath2 = $NewPath } Write-Verbose $NewPath2 explorer.exe $NewPath2 } else { Write-Warning "$NewPath not found" } } |