Update scripts\start.ps1: Fix title setting and missing $dateTime variable

Signed-off-by: Cryostrixx <cryostrixx.dev@gmail.com>
This commit is contained in:
Cryostrixx 2024-10-10 00:31:26 -07:00
parent 09b54a6eee
commit fd8edde129
No known key found for this signature in database
GPG Key ID: 2FC11420AFB82801

View File

@ -79,7 +79,12 @@ if ($processCmd -ne $powershellCmd) {
}
# Set the title of the running PowerShell instance
$BaseWindowTitle = $MyInvocation.MyCommand.Path ?? $MyInvocation.MyCommand.Definition
$BaseWindowTitle = if ($MyInvocation.MyCommand.Path) {
$MyInvocation.MyCommand.Path
} else {
$MyInvocation.MyCommand.Definition
}
$Host.UI.RawUI.WindowTitle = if ($isElevated) {
$BaseWindowTitle + " (Admin)"
} else {
@ -100,7 +105,8 @@ try {
break
}
# Start WinUtil transcript logging-mm-ss"
# Start WinUtil transcript logging
$dateTime = Get-Date -Format "yyyy-MM-dd_HH-mm-ss"
$logdir = "$env:localappdata\winutil\logs"
[System.IO.Directory]::CreateDirectory("$logdir") | Out-Null
Start-Transcript -Path "$logdir\winutil_$dateTime.log" -Append -NoClobber | Out-Null