From fd8edde1297951305268f86a27beaec54e876c8d Mon Sep 17 00:00:00 2001 From: Cryostrixx Date: Thu, 10 Oct 2024 00:31:26 -0700 Subject: [PATCH] Update scripts\start.ps1: Fix title setting and missing $dateTime variable Signed-off-by: Cryostrixx --- scripts/start.ps1 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/start.ps1 b/scripts/start.ps1 index fb6323e0..72243e58 100644 --- a/scripts/start.ps1 +++ b/scripts/start.ps1 @@ -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 \ No newline at end of file