adhoc/Get-RootPath.ps1
|
#$Host.name $rootPath = Switch ($Host.name) { 'Visual Studio Code Host' { split-path $psEditor.GetEditorContext().CurrentFile.Path } 'Windows PowerShell ISE Host' { Split-Path -Path $psISE.CurrentFile.FullPath } 'ConsoleHost' { $PSScriptRoot } } #$parentPath = $rootPath | Split-Path -Parent $rootPath #$parentPath |