Skip to content

Commit

Permalink
feat(shell): add hidden window style to PowerShell script execution
Browse files Browse the repository at this point in the history
Modify PowerShell script execution to run with hidden window style in both TypeScript API and Rust plugin to prevent visible command windows
  • Loading branch information
HuakunShen committed Feb 21, 2025
1 parent 07c62e2 commit 737a33e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/api/src/api/server/shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export function constructShellApi(
ShellPermissionMap.executePowershellScript,
objectPermissions,
"powershell",
["-Command", script]
["-WindowStyle", "Hidden", "-Command", script]
)
return executePowershellScript(script)
}
Expand Down
2 changes: 2 additions & 0 deletions packages/tauri-plugins/jarvis/src/utils/script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ pub fn run_apple_script(script: &str) -> anyhow::Result<String> {

pub fn run_powershell(script: &str) -> anyhow::Result<String> {
let output = Command::new("powershell")
.arg("-WindowStyle")
.arg("Hidden")
.arg("-Command")
.arg(script)
.output()
Expand Down

0 comments on commit 737a33e

Please # to comment.