fix(应用与系统)!: 修复组件执行与参数校验
修正 PID 空结果、目标类型判断与转换、毫秒等待。 让关闭程序和命令行按所选模式显示并校验参数。 统一 PowerShell 输出编码,修正 BAT 路径引号处理。 明确屏保和屏幕唤醒的实际能力,补充缺陷回归测试。 验证:类型检查、构建与组件回归检查通过。 BREAKING CHANGE: 判断数据类型改为返回布尔值。 需要类型名称的旧流程请改用 Basic_Type。 屏保 V1 移除未实现参数,旧自定义密码节点需重新添加。
这个提交包含在:
1 父节点
f74d1865da
当前提交
5f9e28715c
16 个文件已更改
+402
-144
没有与搜索条件相匹配的文件
@@ -45,7 +45,9 @@ function encoded(command: string): string {
|
||||
|
||||
export async function powershell(command: string, timeout = 30000): Promise<string> {
|
||||
try {
|
||||
const result = await execFileAsync("powershell.exe", ["-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-EncodedCommand", encoded(command)], {
|
||||
// Windows PowerShell 的默认输出编码依机器代码页变化;Node 按 UTF-8 解码管道。
|
||||
const utf8 = "$ProgressPreference='SilentlyContinue'; [Console]::OutputEncoding=[System.Text.UTF8Encoding]::new($false); $OutputEncoding=[Console]::OutputEncoding; ";
|
||||
const result = await execFileAsync("powershell.exe", ["-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-EncodedCommand", encoded(utf8 + command)], {
|
||||
windowsHide: true,
|
||||
timeout,
|
||||
maxBuffer: 4 * 1024 * 1024
|
||||
|
||||
在新工单中引用
屏蔽一个用户