improve log logics

This commit is contained in:
MyDrift 2024-08-24 21:53:39 +02:00
parent cfb9edbce7
commit 0e9633a60f
2 changed files with 5 additions and 5 deletions

View File

@ -11,7 +11,7 @@ Function Update-WinUtilProgramWinget {
$host.ui.RawUI.WindowTitle = """Winget Install""" $host.ui.RawUI.WindowTitle = """Winget Install"""
Start-Transcript $ENV:TEMP\winget-update.log -Append Start-Transcript "$logdir\winget-update_$dateTime.log" -Append
winget upgrade --all --accept-source-agreements --accept-package-agreements --scope=machine --silent winget upgrade --all --accept-source-agreements --accept-package-agreements --scope=machine --silent
} }

View File

@ -27,11 +27,11 @@ if ($Run) {
$PARAM_RUN = $true $PARAM_RUN = $true
} }
if (!(Test-Path -Path $ENV:TEMP)) { $dateTime = Get-Date -Format "dd-MM-yyyy_HH-mm-ss"
New-Item -ItemType Directory -Force -Path $ENV:TEMP
}
Start-Transcript $ENV:TEMP\Winutil.log -Append $logdir = "$env:localappdata\Winutil\Log"
[System.IO.Directory]::CreateDirectory("$logdir")
Start-Transcript -Path "$logdir\Winutil_$dateTime.log" -Append
# Load DLLs # Load DLLs
Add-Type -AssemblyName PresentationFramework Add-Type -AssemblyName PresentationFramework