mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-06-14 17:06:55 +02:00
Update cd-crashdumps.ps1
This commit is contained in:
parent
7b942b4fec
commit
3b50516e17
@ -2,7 +2,7 @@
|
|||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Change to the crash dumps folder
|
Change to the crash dumps folder
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
This PowerShell script changes the working directory to the crash dumps directory.
|
This PowerShell script changes the working directory to the crash dumps directory (Windows only).
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> ./cd-crashdumps
|
PS> ./cd-crashdumps
|
||||||
📂C:\Users\Markus\AppData\Local\CrashDumps
|
📂C:\Users\Markus\AppData\Local\CrashDumps
|
||||||
@ -13,7 +13,10 @@
|
|||||||
#>
|
#>
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$Path = Resolve-Path -Path "~/AppData/Local/CrashDumps"
|
[string]$Path = Resolve-Path -Path "~"
|
||||||
|
if (!(Test-Path $Path)) { throw "Home directory at $Path doesn't exist (yet)" }
|
||||||
|
$Path += "\AppData\Local\CrashDumps"
|
||||||
|
if (!(Test-Path $Path)) { throw "Crashdumps directory at $Path doesn't exist (yet)" }
|
||||||
Set-Location "$Path"
|
Set-Location "$Path"
|
||||||
"📂$Path"
|
"📂$Path"
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
|
Loading…
x
Reference in New Issue
Block a user