修复Way05无法带参

This commit is contained in:
Nepenthe 2024-07-29 23:32:34 +08:00
parent 5f15774ec7
commit 4501d73134
2 changed files with 18 additions and 5 deletions

View File

@ -45,7 +45,14 @@ $jsCode | Out-File -FilePath $jsFilePath -Encoding UTF8
Write-Output "JavaScript code has been generated and saved to $jsFilePath"
# 设置NAPCAT_PATH环境变量为 当前目录的loadScript.js地址
$env:NAPCAT_PATH = $jsFilePath
for ($i = 0; $i -lt $args.Length; $i++) {
$param = $args[$i]
if ($args[$i] -eq "-q" -and $i + 1 -lt $args.Length) {
$nextParam = $args[$i + 1]
$params = "$param $nextParam"
break
}
}
Try {
$QQpath = Get-QQpath
}
@ -57,4 +64,4 @@ Catch {
}
$commandInfo = Get-Command $QQpath -ErrorAction Stop
Start-Process powershell -ArgumentList "-noexit", "-noprofile", "-command &{& chcp 65001;& '$($commandInfo.Path)' --enable-logging }"
Start-Process powershell -ArgumentList "-noexit", "-noprofile", "-command &{& chcp 65001;& '$($commandInfo.Path)' --enable-logging $params}"

View File

@ -45,8 +45,14 @@ $jsCode | Out-File -FilePath $jsFilePath -Encoding UTF8
Write-Output "JavaScript code has been generated and saved to $jsFilePath"
# 设置NAPCAT_PATH环境变量为 当前目录的loadScript.js地址
$env:NAPCAT_PATH = $jsFilePath
$params = $args -join " "
for ($i = 0; $i -lt $args.Length; $i++) {
$param = $args[$i]
if ($args[$i] -eq "-q" -and $i + 1 -lt $args.Length) {
$nextParam = $args[$i + 1]
$params = "$param $nextParam"
break
}
}
Try {
$QQpath = Get-QQpath
}