dsh-ris-ide 1.7.2 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/README.md +43 -4
  2. package/bin/check-listing.mjs +247 -0
  3. package/bin/proxy-janitor.mjs +183 -0
  4. package/bin/risd.mjs +287 -0
  5. package/bin/run-with-log.ps1 +43 -5
  6. package/lib/client-codemirror.js +92 -66
  7. package/lib/client.js +774 -89
  8. package/lib/index.js +2256 -21
  9. package/lib/janitor.js +377 -0
  10. package/lib/proxy.js +1577 -0
  11. package/lib/proxybridge-bundle.js +798 -0
  12. package/lib/redirector.js +2558 -0
  13. package/lib/risd/build.js +91 -0
  14. package/lib/risd/debug.js +374 -0
  15. package/lib/risd/git.js +207 -0
  16. package/lib/risd/leases.js +124 -0
  17. package/lib/risd/lifecycle.js +148 -0
  18. package/lib/risd/log.js +59 -0
  19. package/lib/risd/ping.js +94 -0
  20. package/lib/risd/programs.js +348 -0
  21. package/lib/risd/server.js +1478 -0
  22. package/lib/risd/state.js +137 -0
  23. package/lib/risd/ui.js +1705 -0
  24. package/lib/risd/view.js +79 -0
  25. package/lib/risd-client.js +282 -0
  26. package/lib/standalone/window.html +14 -16
  27. package/lib/startup.js +114 -0
  28. package/package.json +7 -2
  29. package/skills/dsh-ris-ide-debug/SKILL.md +37 -2
  30. package/test/client-build.test.mjs +113 -0
  31. package/test/client-viewer.test.mjs +314 -20
  32. package/test/companion.test.mjs +65 -0
  33. package/test/dsh-origin.test.mjs +140 -0
  34. package/test/dsh-window-refresh.test.mjs +100 -0
  35. package/test/harness.test.mjs +9 -0
  36. package/test/host-noloop.test.mjs +74 -0
  37. package/test/host-tail.test.mjs +54 -5
  38. package/test/host-window.test.mjs +4 -4
  39. package/test/inherit-engine.test.mjs +175 -0
  40. package/test/install-phase.test.mjs +36 -0
  41. package/test/janitor.test.mjs +172 -0
  42. package/test/lifecycle.test.mjs +109 -0
  43. package/test/merge-owners.test.mjs +155 -0
  44. package/test/proxy-restart.test.mjs +37 -0
  45. package/test/proxy-route.test.mjs +599 -0
  46. package/test/proxy-window.test.mjs +45 -0
  47. package/test/proxy.test.mjs +914 -0
  48. package/test/proxybridge-bundle.test.mjs +687 -0
  49. package/test/redirector-bundle.test.mjs +391 -0
  50. package/test/redirector.test.mjs +571 -0
  51. package/test/risd-api.test.mjs +470 -0
  52. package/test/risd-bridge-degrade.test.mjs +101 -0
  53. package/test/risd-build.test.mjs +20 -0
  54. package/test/risd-cli-home.test.mjs +50 -0
  55. package/test/risd-client.test.mjs +130 -0
  56. package/test/risd-debug.test.mjs +261 -0
  57. package/test/risd-election.test.mjs +104 -0
  58. package/test/risd-engine.test.mjs +132 -0
  59. package/test/risd-entry.test.mjs +118 -0
  60. package/test/risd-git.test.mjs +109 -0
  61. package/test/risd-handoff.test.mjs +116 -0
  62. package/test/risd-heal.test.mjs +50 -0
  63. package/test/risd-helpers.mjs +108 -0
  64. package/test/risd-host-p2.test.mjs +147 -0
  65. package/test/risd-janitor-guard.test.mjs +46 -0
  66. package/test/risd-lease.test.mjs +83 -0
  67. package/test/risd-lifecycle.test.mjs +210 -0
  68. package/test/risd-log-follow.test.mjs +227 -0
  69. package/test/risd-mode.test.mjs +161 -0
  70. package/test/risd-ping.test.mjs +99 -0
  71. package/test/risd-programs.test.mjs +169 -0
  72. package/test/risd-review-p2.test.mjs +217 -0
  73. package/test/risd-shutdown.test.mjs +97 -0
  74. package/test/risd-teardown.test.mjs +87 -0
  75. package/test/risd-tools.test.mjs +211 -0
  76. package/test/risd-ui.test.mjs +445 -0
  77. package/test/risd-write.test.mjs +170 -0
  78. package/test/startup-reconcile.test.mjs +100 -0
  79. package/test/windows.test.mjs +37 -2
package/bin/risd.mjs ADDED
@@ -0,0 +1,287 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * risd — command line.
4
+ *
5
+ * risd serve [--home <dir>] [--port <n>] run the daemon (the only mode that listens)
6
+ * risd status [--home <dir>] print the stored state + a health probe
7
+ * risd health [--home <dir>] print the health JSON (for scripts)
8
+ * risd stop [--home <dir>] [--handoff] ask a running daemon to exit
9
+ * (--handoff keeps the engine for a successor)
10
+ * risd version print daemon + api version
11
+ *
12
+ * Exit codes for `serve` (what the plugin's spawn path distinguishes):
13
+ * 0 started, or another daemon already owns the port
14
+ * 3 another process speaks a different `/v1` version -> upgrade required
15
+ * 4 the port is occupied by something that is not risd
16
+ * 1 anything else (bad args, state could not be written)
17
+ *
18
+ * Kept deliberately thin: all behaviour lives in `lib/risd/*` so it is testable
19
+ * without spawning a process (the tests do both).
20
+ *
21
+ * @module dsh-risd/cli
22
+ */
23
+ import { readFileSync } from 'node:fs'
24
+ import { DEFAULT_RISD_PORT, RISD_API_VERSION, risdHomeDir, risdStatePath, readRisdState, dropStaleSpawnLock } from '../lib/risd/state.js'
25
+ import { pidAlive } from '../lib/proxy.js'
26
+ import { createRisdLogger, risdLogPath } from '../lib/risd/log.js'
27
+ import { startRisd } from '../lib/risd/server.js'
28
+ import { probeRisdHealth } from '../lib/risd/server.js'
29
+
30
+ const PACKAGE_VERSION = (() => {
31
+ try {
32
+ return JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')).version ?? '0.0.0'
33
+ } catch {
34
+ return '0.0.0'
35
+ }
36
+ })()
37
+
38
+ function parseArgs(argv) {
39
+ const options = { command: 'status', home: undefined, port: undefined }
40
+ const rest = []
41
+ for (let index = 0; index < argv.length; index += 1) {
42
+ const arg = argv[index]
43
+ if (arg === '--home' || arg === '-C') options.home = argv[++index]
44
+ else if (arg.startsWith('--home=')) options.home = arg.slice('--home='.length)
45
+ else if (arg === '--handoff') options.handoff = true
46
+ // m11421: successor started by POST /v1/restart — wait for the predecessor to
47
+ // exit so the port is free and the handoff stamp is on disk.
48
+ else if (arg === '--wait-pid') options.waitPid = Number(argv[++index])
49
+ else if (arg === '--port' || arg === '-p') options.port = Number(argv[++index])
50
+ else if (arg.startsWith('--port=')) options.port = Number(arg.slice('--port='.length))
51
+ else if (arg.startsWith('-')) throw new Error(`unknown option: ${arg}`)
52
+ else rest.push(arg)
53
+ }
54
+ if (rest.length > 0) options.command = rest[0]
55
+ if (options.port !== undefined && (!Number.isInteger(options.port) || options.port < 0 || options.port > 65535)) {
56
+ throw new Error(`invalid --port: ${options.port}`)
57
+ }
58
+ if (options.waitPid !== undefined && (!Number.isInteger(options.waitPid) || options.waitPid <= 0)) {
59
+ throw new Error(`invalid --wait-pid: ${options.waitPid}`)
60
+ }
61
+ return options
62
+ }
63
+
64
+ function line(text) {
65
+ process.stdout.write(`${text}\n`)
66
+ }
67
+
68
+ async function request(state, path, { method = 'GET', body = undefined, timeoutMs = 2000 } = {}) {
69
+ const response = await fetch(`${state.url}${path}`, {
70
+ method,
71
+ headers: {
72
+ authorization: `Bearer ${state.token}`,
73
+ 'x-risd-api-version': String(RISD_API_VERSION),
74
+ ...(body === undefined ? {} : { 'content-type': 'application/json' }),
75
+ },
76
+ body: body === undefined ? undefined : JSON.stringify(body),
77
+ signal: AbortSignal.timeout(timeoutMs),
78
+ })
79
+ const text = await response.text()
80
+ let payload
81
+ try {
82
+ payload = JSON.parse(text)
83
+ } catch {
84
+ payload = { ok: false, code: 'bad-response', message: text.slice(0, 200) }
85
+ }
86
+ return { status: response.status, payload }
87
+ }
88
+
89
+ /** Resolve once `pid` is gone (ESRCH) or the deadline passes; never throws. */
90
+ function waitForPidExit(pid, timeoutMs) {
91
+ const deadline = Date.now() + timeoutMs
92
+ return new Promise((resolve) => {
93
+ const tick = () => {
94
+ let alive = true
95
+ try { process.kill(pid, 0) } catch (error) { alive = error.code === 'EPERM' }
96
+ if (!alive || Date.now() > deadline) { resolve(); return }
97
+ setTimeout(tick, 100)
98
+ }
99
+ tick()
100
+ })
101
+ }
102
+
103
+ async function serve(options) {
104
+ // Never assign `undefined` to process.env: it becomes the string "undefined",
105
+ // which then resolves every machine-level file (state, token, heartbeat) under
106
+ // `<cwd>/undefined/`. `risdHomeDir()` falls back to the real proxy home.
107
+ const home = risdHomeDir(options.home)
108
+ // A successor spawned by POST /v1/restart must not treat the dying predecessor as
109
+ // "already running": wait until its pid is gone, then serve (m11421).
110
+ if (options.waitPid !== undefined) await waitForPidExit(options.waitPid, 20000)
111
+ // Heartbeat, janitor state and the git-proxy entry all resolve through the
112
+ // machine-level home; a daemon started for a test home must not touch the real
113
+ // one, and the plugin always points at the same home it reads `risd.json` from.
114
+ process.env.DSH_RIS_IDE_PROXY_HOME = home
115
+ const logger = createRisdLogger(home)
116
+ logger.info(`starting: pid=${process.pid} version=${PACKAGE_VERSION}`)
117
+ dropStaleSpawnLock(home)
118
+ let stopping = false
119
+ let current = null
120
+ const stop = async (code, handoff = false) => {
121
+ if (stopping) return
122
+ stopping = true
123
+ logger.info(handoff ? 'stopping: handoff requested' : 'stopping: shutdown requested')
124
+ try {
125
+ await current?.stop({ handoff })
126
+ } finally {
127
+ process.exit(code)
128
+ }
129
+ }
130
+ const envPort = Number(process.env.DSH_RISD_PORT)
131
+ const port = options.port ?? (Number.isInteger(envPort) && envPort >= 0 ? envPort : DEFAULT_RISD_PORT)
132
+ const started = await startRisd({
133
+ home,
134
+ port,
135
+ version: PACKAGE_VERSION,
136
+ onShutdown: (handoff) => stop(0, handoff === true),
137
+ })
138
+ if (!started.ok) {
139
+ if (started.code === 'already-running') {
140
+ logger.info(`already running: pid=${started.pid} port=${started.port}`)
141
+ process.stderr.write(`risd: already running (pid ${started.pid}) on 127.0.0.1:${started.port}\n`)
142
+ process.exit(0)
143
+ }
144
+ if (started.code === 'api-mismatch') {
145
+ logger.warn(`api mismatch: found ${started.found} on port ${started.port}`)
146
+ process.stderr.write(`risd: a daemon with apiVersion ${started.found} is running on 127.0.0.1:${started.port}; this build speaks ${RISD_API_VERSION} (upgrade required)\n`)
147
+ process.exit(3)
148
+ }
149
+ if (started.code === 'home-mismatch') {
150
+ // Two homes on one port cannot both own the state file; the healthy daemon
151
+ // wins and this one explains how to run alongside it (review A-P2-9).
152
+ logger.warn(`home mismatch: ${started.found} already owns port ${started.port}`)
153
+ process.stderr.write(
154
+ `risd: 127.0.0.1:${started.port} is already served by the daemon whose home is ${started.found};\n` +
155
+ ` this process wants home ${started.home}. Stop that daemon or run with --port <n>.\n`,
156
+ )
157
+ process.exit(4)
158
+ }
159
+ if (started.code === 'port-busy') {
160
+ logger.warn(`port busy: ${started.port} is not risd`)
161
+ process.stderr.write(
162
+ `risd: 127.0.0.1:${started.port} is occupied by a process that is not risd.\n` +
163
+ ` stop it, or pick another port (risd serve --port <n>, DSH_RISD_PORT, or daemonMode stays off)\n`,
164
+ )
165
+ process.exit(4)
166
+ }
167
+ logger.error(`start failed: ${started.code} ${started.error?.message ?? ''}`)
168
+ process.stderr.write(`risd: could not start (${started.code}): ${started.error?.message ?? ''}\n`)
169
+ process.exit(1)
170
+ }
171
+ current = started
172
+ logger.info(`ready: port=${started.port} state=${risdStatePath(home)}`)
173
+ process.stderr.write(`risd: listening on http://127.0.0.1:${started.port} (pid ${process.pid})\n`)
174
+ process.stderr.write(`risd: maintenance page http://127.0.0.1:${started.port}/ui (engine/programs/logs/debug, no dsh needed)\n`)
175
+ for (const signal of ['SIGTERM', 'SIGINT']) {
176
+ process.once(signal, () => void stop(0))
177
+ }
178
+ }
179
+
180
+ async function status(options) {
181
+ const state = readRisdState(options.home)
182
+ if (state === null) {
183
+ line('risd: not running (no risd.json)')
184
+ line('hint: run `risd serve` to start it (clicking ⧉ in dsh also starts it)')
185
+ return 1
186
+ }
187
+ const probe = await probeRisdHealth(state.port, 1000)
188
+ line(`risd: ${probe?.ok === true ? 'running' : 'unreachable'}`)
189
+ if (probe?.ok !== true) line('hint: the state file is stale; run `risd serve` to restart (clicking ⧉ in dsh also starts it)')
190
+ line(` pid ${state.pid}`)
191
+ line(` port ${state.port}`)
192
+ line(` api ${state.apiVersion} (this CLI speaks ${RISD_API_VERSION})`)
193
+ line(` version ${state.version}`)
194
+ line(` startedAt ${state.startedAt}`)
195
+ line(` home ${state.home}`)
196
+ line(` log ${risdLogPath(options.home)}`)
197
+ line(` page http://127.0.0.1:${state.port}/ui`)
198
+ return probe?.ok === true ? 0 : 1
199
+ }
200
+
201
+ async function health(options) {
202
+ const state = readRisdState(options.home)
203
+ if (state === null) {
204
+ process.stderr.write('risd: not running (no risd.json)\n')
205
+ process.stderr.write('hint: run `risd serve` to start it (clicking ⧉ in dsh also starts it)\n')
206
+ return 1
207
+ }
208
+ const { status: code, payload } = await request(state, '/v1/health', { timeoutMs: 1000 }).catch((error) => ({
209
+ status: 0,
210
+ payload: { ok: false, code: 'unreachable', message: String(error?.message ?? error) },
211
+ }))
212
+ line(JSON.stringify(payload, null, 2))
213
+ return code === 200 ? 0 : 1
214
+ }
215
+
216
+ async function stop(options) {
217
+ const state = readRisdState(options.home)
218
+ if (state === null) {
219
+ line('risd: not running (no risd.json)')
220
+ return 0
221
+ }
222
+ const handoff = options.handoff === true
223
+ const { status: code, payload } = await request(state, '/v1/shutdown', { method: 'POST', body: { reason: 'cli', handoff } }).catch((error) => ({
224
+ status: 0,
225
+ payload: { ok: false, code: 'unreachable', message: String(error?.message ?? error) },
226
+ }))
227
+ if (code !== 200) {
228
+ line(`risd: shutdown failed (${code}): ${payload?.message ?? payload?.code ?? 'unknown'}`)
229
+ return 1
230
+ }
231
+ if (handoff) {
232
+ // A handoff keeps risd.json on purpose (the successor reads it). Wait for the
233
+ // pid to change instead of for the file to disappear, so "handed off" only
234
+ // means success once somebody actually took over (review A-P2-7).
235
+ for (let attempt = 0; attempt < 100; attempt += 1) {
236
+ const next = readRisdState(options.home)
237
+ if (next !== null && Number(next.pid) !== Number(state.pid) && pidAlive(next.pid)) {
238
+ line(`risd: handed off to pid ${next.pid}`)
239
+ return 0
240
+ }
241
+ await new Promise((resolve) => setTimeout(resolve, 100))
242
+ }
243
+ line('risd: handed off, but no successor picked it up yet (the janitor keeps the engine)')
244
+ return 1
245
+ }
246
+ // 10 s: shutdown stops supervised programs first and then the network layers, so
247
+ // a busy machine can legitimately need more than the old 5 s (and the generic
248
+ // "still running" answer made `risd stop` look broken).
249
+ for (let attempt = 0; attempt < 100; attempt += 1) {
250
+ // `state` may be rewritten by a successor; the pid, not the file, says whether
251
+ // OUR daemon is gone (review A-P2-7).
252
+ if (!pidAlive(state.pid)) {
253
+ line('risd: stopped')
254
+ return 0
255
+ }
256
+ await new Promise((resolve) => setTimeout(resolve, 100))
257
+ }
258
+ line('risd: shutdown accepted but the daemon is still running')
259
+ return 1
260
+ }
261
+
262
+ async function main() {
263
+ let options
264
+ try {
265
+ options = parseArgs(process.argv.slice(2))
266
+ } catch (error) {
267
+ process.stderr.write(`risd: ${error.message}\n`)
268
+ process.exit(1)
269
+ }
270
+ if (options.command === 'version' || options.command === '--version') {
271
+ line(`risd ${PACKAGE_VERSION} (apiVersion ${RISD_API_VERSION})`)
272
+ return 0
273
+ }
274
+ if (options.command === 'serve') {
275
+ await serve(options)
276
+ return 0
277
+ }
278
+ if (options.command === 'status') return status(options)
279
+ if (options.command === 'health') return health(options)
280
+ if (options.command === 'stop') return stop(options)
281
+ process.stderr.write(`risd: unknown command "${options.command}" (serve|status|health|stop|version)\n`)
282
+ return 1
283
+ }
284
+
285
+ main().then((code) => {
286
+ process.exitCode = typeof code === 'number' ? code : 0
287
+ })
@@ -1,4 +1,4 @@
1
- #requires -Version 5.1
1
+ #requires -Version 5.1
2
2
  <#
3
3
  .SYNOPSIS
4
4
  dsh-ris-ide 的 Windows wrapper:把服务输出写进日志、写 pidfile、让面板能停能查。
@@ -15,7 +15,11 @@
15
15
  - spring : 依次 `mvn -Pdev compile`、`mvn -Pdev dependency:build-classpath …`,
16
16
  然后 `java -DJM.LOG.PATH=… -Dcsp.sentinel.log.dir=… <jvmArgs> -cp "target\classes;<cp>" <mainClass> <args>`;
17
17
  - frontend : `<pnpm|npm|yarn>.cmd run <script>`;
18
- - command : 用户的 `startCommand`,交给 `cmd.exe /d /s /c` 执行。
18
+ - command : 用户的 `startCommand`,交给 `cmd.exe /d /s /c "<命令原样>"` 执行;
19
+ bash 方言($()、${...}、exec)会直接启动失败并在日志里提示改用 runtime:"bash"。
20
+
21
+ 本文件必须以 UTF-8 with BOM 保存:Windows PowerShell 5.1 对没有 BOM 的文件按 ANSI
22
+ 解码,中文注释会与换行拼错行(真机已复现),导致代码行被吞掉。
19
23
 
20
24
  pidfile 与 .sh 一致:`<log>.pid` 一行 `<servicePid> <wrapperPid> <epochMs> [<stopGraceMs>]`。
21
25
  停止由宿主 `taskkill /PID <wrapperPid> /T /F` 完成(Windows 没有 POSIX 信号/进程组,
@@ -47,6 +51,29 @@ function Quote-WinArg([string]$Value) {
47
51
  return '"' + ($Value -replace '"', '\"') + '"'
48
52
  }
49
53
 
54
+ <#
55
+ startCommand is a command for the CURRENT runtime's shell: with runtime=powershell
56
+ it goes to cmd.exe /d /s /c, with runtime=bash it goes to bash -lc. Bash syntax
57
+ ($(...), ${...}, exec) is not expanded/understood by cmd; failing with a clear hint
58
+ beats silently running a broken command line. ${JDWP_ARGS} has already been
59
+ substituted by the host, so a remaining ${...} is a suspicious bash expansion.
60
+
61
+ Keep these messages ASCII: Windows PowerShell 5.1 reads a BOM-less file as ANSI,
62
+ so non-ASCII string literals would be garbled in the log.
63
+ #>
64
+ function Assert-CommandDialect([string]$Command) {
65
+ $Hint = ' This program runs with runtime "powershell" on Windows, so the startCommand is executed by cmd.exe.'
66
+ if ($Command -match '\$\(') {
67
+ throw ('startCommand uses bash command substitution $(...), which cmd cannot run.' + $Hint + ' Set runtime to "bash" for this program (requires Git Bash) or rewrite it as a cmd command. command: ' + $Command)
68
+ }
69
+ if ($Command -match '\$\{[^}]*\}') {
70
+ throw ('startCommand uses ${...} variable expansion, which is bash syntax.' + $Hint + ' Use %VAR% or set runtime to "bash". command: ' + $Command)
71
+ }
72
+ if ($Command -match '(^|\s|&&|\|\|)exec\s+') {
73
+ throw ('startCommand uses the bash exec builtin.' + $Hint + ' Drop exec (Windows starts the process directly) or set runtime to "bash". command: ' + $Command)
74
+ }
75
+ }
76
+
50
77
  $SpecJson = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($SpecBase64))
51
78
  $Spec = $SpecJson | ConvertFrom-Json
52
79
 
@@ -67,6 +94,8 @@ Write-Log $LogFile ('--- kind: ' + $Kind + ' dir: ' + $WorkDir + ' ---')
67
94
 
68
95
  $Exe = $null
69
96
  $ArgList = @()
97
+ # kind=command sets this to a raw cmd.exe argument line instead of a quoted argv.
98
+ $RawArgs = $null
70
99
 
71
100
  try {
72
101
  switch ($Kind) {
@@ -105,9 +134,15 @@ try {
105
134
  $ArgList = @('run', $Script)
106
135
  }
107
136
  default {
137
+ $Command = [string]$Spec.command
138
+ if ([string]::IsNullOrWhiteSpace($Command)) { throw 'startCommand is empty (nothing to run)' }
139
+ Assert-CommandDialect $Command
108
140
  $Exe = Resolve-CommandPath @('cmd.exe')
109
141
  if ($null -eq $Exe) { throw 'cmd.exe not found' }
110
- $ArgList = @('/d', '/s', '/c', [string]$Spec.command)
142
+ # 命令交给 cmd.exe /d /s /c;`/s` 至多剥掉首尾各一个引号,所以整条命令包一层
143
+ # 引号、内部引号原样保留才是 cmd 的语义。旧的 argv+Quote-WinArg 组装会把内部
144
+ # " 变成 cmd 不认识的 \"(cmd 不是 .NET 参数解析器)。
145
+ $RawArgs = '/d /s /c "' + $Command + '"'
111
146
  }
112
147
  }
113
148
  } catch {
@@ -115,7 +150,10 @@ try {
115
150
  exit 1
116
151
  }
117
152
 
118
- Write-Log $LogFile ('--- exec: ' + $Exe + ' ' + (($ArgList | ForEach-Object { Quote-WinArg ([string]$_) }) -join ' ') + ' ---')
153
+ # kind=command 用 cmd.exe 的原始参数行(见上);其余 kind 都是结构化 argv,逐项引用。
154
+ $ExecArgs = if ($null -ne $RawArgs) { $RawArgs } else { (($ArgList | ForEach-Object { Quote-WinArg ([string]$_) }) -join ' ') }
155
+
156
+ Write-Log $LogFile ('--- exec: ' + $Exe + ' ' + $ExecArgs + ' ---')
119
157
 
120
158
  $StartInfo = New-Object System.Diagnostics.ProcessStartInfo
121
159
  $StartInfo.FileName = $Exe
@@ -124,7 +162,7 @@ $StartInfo.UseShellExecute = $false
124
162
  $StartInfo.RedirectStandardOutput = $true
125
163
  $StartInfo.RedirectStandardError = $true
126
164
  $StartInfo.CreateNoWindow = $true
127
- $StartInfo.Arguments = (($ArgList | ForEach-Object { Quote-WinArg ([string]$_) }) -join ' ')
165
+ $StartInfo.Arguments = $ExecArgs
128
166
 
129
167
  $Process = New-Object System.Diagnostics.Process
130
168
  $Process.StartInfo = $StartInfo