From 2f8187cb82a23edc87408e2695a675fc75f69f23 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Wed, 9 Mar 2022 07:57:40 +0100 Subject: [PATCH] Update cd-root.ps1 --- Scripts/cd-root.ps1 | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/Scripts/cd-root.ps1 b/Scripts/cd-root.ps1 index 58355d19..099d86d3 100755 --- a/Scripts/cd-root.ps1 +++ b/Scripts/cd-root.ps1 @@ -2,10 +2,9 @@ .SYNOPSIS Sets the working directory to the root directory .DESCRIPTION - This PowerShell script changes the working directory to the root directory (C:\ on Windows). + This PowerShell script changes the current working directory to the root directory (C:\ on Windows). .EXAMPLE PS> ./cd-root - 📂C:\ .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -13,14 +12,7 @@ #> try { - if ($IsLinux) { - $Path = resolve-path "/" - } else { - $Path = resolve-path "C:\" - } - if (-not(test-path "$Path" -pathType container)) { - throw "Root directory at 📂$Path doesn't exist (yet)" - } + if ($IsLinux) { $Path = "/" } else { $Path = "C:\" } set-location "$Path" "📂$Path" exit 0 # success