mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-05-05 16:14:42 +02:00
Update the scripts
This commit is contained in:
parent
e8b0875b2a
commit
41e06dd2f8
@ -16,8 +16,10 @@
|
|||||||
param([string]$text = "")
|
param([string]$text = "")
|
||||||
|
|
||||||
function GetTempDir {
|
function GetTempDir {
|
||||||
|
if ("$env:TEMP" -ne "") { return "$env:TEMP" }
|
||||||
|
if ("$env:TMP" -ne "") { return "$env:TMP" }
|
||||||
if ($IsLinux) { return "/tmp" }
|
if ($IsLinux) { return "/tmp" }
|
||||||
return "$env:TEMP"
|
return "C:\Temp"
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -12,16 +12,18 @@
|
|||||||
#>
|
#>
|
||||||
|
|
||||||
function GetTempDir {
|
function GetTempDir {
|
||||||
|
if ("$env:TEMP" -ne "") { return "$env:TEMP" }
|
||||||
|
if ("$env:TMP" -ne "") { return "$env:TMP" }
|
||||||
if ($IsLinux) { return "/tmp" }
|
if ($IsLinux) { return "/tmp" }
|
||||||
return "$env:TEMP"
|
return "C:\Temp"
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$TargetDir = resolve-path GetTempDir
|
$Path = GetTempDir
|
||||||
if (-not(test-path "$TargetDir" -pathType container)) {
|
if (-not(test-path "$Path" -pathType container)) {
|
||||||
throw "Temporary folder at 📂$TargetDir doesn't exist (yet)"
|
throw "Temporary folder at 📂$Path doesn't exist (yet)"
|
||||||
}
|
}
|
||||||
& "$PSScriptRoot/open-file-explorer.ps1" "$TargetDir"
|
& "$PSScriptRoot/open-file-explorer.ps1" "$Path"
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||||
|
@ -12,8 +12,10 @@
|
|||||||
#>
|
#>
|
||||||
|
|
||||||
function GetTempDir {
|
function GetTempDir {
|
||||||
|
if ("$env:TEMP" -ne "") { return "$env:TEMP" }
|
||||||
|
if ("$env:TMP" -ne "") { return "$env:TMP" }
|
||||||
if ($IsLinux) { return "/tmp" }
|
if ($IsLinux) { return "/tmp" }
|
||||||
return "$env:TEMP"
|
return "C:\Temp"
|
||||||
}
|
}
|
||||||
|
|
||||||
if (test-path "$(GetTempDir)/last_reply_given.txt" -pathType leaf) {
|
if (test-path "$(GetTempDir)/last_reply_given.txt" -pathType leaf) {
|
||||||
|
Loading…
Reference in New Issue
Block a user