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