Updated the cd-*.ps1 scripts

This commit is contained in:
Markus Fleschutz
2025-07-09 14:19:53 +02:00
parent d3e77308a8
commit 51b541e0de
30 changed files with 115 additions and 65 deletions

View File

@ -12,6 +12,8 @@
Author: Markus Fleschutz | License: CC0
#>
#requires -version 5.1
function GetTempDir {
if ("$env:TEMP" -ne "") { return "$env:TEMP" }
if ("$env:TMP" -ne "") { return "$env:TMP" }
@ -21,9 +23,7 @@ function GetTempDir {
try {
$path = GetTempDir
if (-not(Test-Path "$path" -pathType container)) { throw
"No temporary folder at: $path"
}
if (-not(Test-Path "$path" -pathType container)) { throw "No temporary folder at: $path" }
Set-Location "$path"
$files = Get-ChildItem $path -attributes !Directory
$folders = Get-ChildItem $path -attributes Directory