mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-04-01 17:12:09 +00:00
Update scripts\start.ps1: Fix title setting and missing $dateTime variable
Signed-off-by: Cryostrixx <cryostrixx.dev@gmail.com>
This commit is contained in:
parent
09b54a6eee
commit
fd8edde129
@ -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
|
Loading…
Reference in New Issue
Block a user