From 17b303762223230b19a59a2e10f6e96ad300bd5b Mon Sep 17 00:00:00 2001 From: Space Time Date: Sat, 14 Sep 2024 10:32:19 +0800 Subject: [PATCH] =?UTF-8?q?1.1.1.4=20=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Console-HostChecker.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Console-HostChecker.ps1 b/Console-HostChecker.ps1 index 60d264c..fd7ac61 100644 --- a/Console-HostChecker.ps1 +++ b/Console-HostChecker.ps1 @@ -1,7 +1,7 @@ -param ([switch] $trans, [switch] $loop) +param ([string] $trans, [switch] $loop) do { - if ($trans) { Start-Transcript (Join-Path $PSScriptRoot "Trans.log") -UseMinimalHeader | Out-Null } + if (Test-Path $trans) { Start-Transcript (Join-Path $PSScriptRoot "Trans.log") -UseMinimalHeader | Out-Null } if ($PSEdition -ne "Core") { Write-Host "Console HostChecker 需要在 PowerShell 7.x 环境运行" @@ -14,7 +14,7 @@ do { [App]::new().Main() } - if ($trans) { Stop-Transcript } + if (Test-Path $trans) { Stop-Transcript } if ($loop) { Start-Sleep 60 } } while ($loop)