Skip to content

Commit 901d975

Browse files
authored
Fixed temporary directory location
1 parent 5e78937 commit 901d975

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

sit-stand.ps1

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ Param(
3636
[Parameter(Mandatory = $false, HelpMessage = "Display this help message")][switch]$help,
3737
[Parameter(Mandatory = $false, HelpMessage = "Uninstall")][switch]$uninstall
3838
)
39+
if ( test-path $env:TEMP ) {
40+
$null = Set-Location $env:TEMP
41+
}
42+
elseif ( test-path "c:\windows\temp" ) {
43+
$null = Set-Location "c:\windows\temp"
44+
}
3945
Add-Type -AssemblyName System.Drawing
4046
Add-Type -AssemblyName System.Windows.Forms
4147
Add-Type -AssemblyName PresentationFramework
@@ -425,7 +431,11 @@ Function GetIcon {
425431
$Rectangle = [System.Drawing.RectangleF]::FromLTRB(0, 0, 128, 128)
426432
$graphics.DrawString($number, $Font, $bg, $rectangle, $format)
427433
$graphics.Dispose()
428-
Return [System.Drawing.Icon]::FromHandle(([System.Drawing.Bitmap]::new($bmp).GetHIcon()))
434+
#$icon = ([System.Drawing.Icon]::FromHandle(([System.Drawing.Bitmap]::new($graphics).GetHIcon())))
435+
#$icon = ([System.Drawing.Icon]::FromHandle(([System.Drawing.Bitmap]::new($graphics).GetHIcon())))
436+
#$icon = $bmp.GetHIcon()
437+
$icon = [System.Drawing.Icon]::FromHandle(([System.Drawing.Bitmap]::new($bmp).GetHIcon()))
438+
Return $icon
429439
}
430440

431441
# experimental setting to check "focus assist"
@@ -448,4 +458,4 @@ function DisturbOk {
448458
else { return $true }
449459
}
450460

451-
& $MainFunction
461+
& $MainFunction

0 commit comments

Comments
 (0)