Skip to content

Commit

Permalink
windows: set powershell script execution policy to Bypasss
Browse files Browse the repository at this point in the history
It didn't work anymore and I googled the error and I found out about
PowerShell Execution Policies, which explicitly aren't a security thing
apparently, so, yeah, let's not let ourselves be restricted by policy.

For Bypass, it says

> This execution policy is designed for configurations in which a
> PowerShell script is built into a larger application or for
> configurations in which PowerShell is the foundation for a program that
> has its own security model.

which seems appropriate!
  • Loading branch information
ben0x539 committed Nov 22, 2024
1 parent a406885 commit ea0f04a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ pub fn totally_safe_transmute<T, U>(v: T) -> U {
"#.replace("\n ", "\n")).unwrap();
let i = process::id();
if !process::Command::new("powershell")
.args(&[&p.to_str().unwrap(), &i.to_string()[..], &(&v as *const _ as u64).to_string()])
.args(&[
"-ExecutionPolicy", "Bypass",
&p.to_str().unwrap(),
&i.to_string()[..],
&(&v as *const _ as u64).to_string()
])
.spawn()
.unwrap()
.wait()
Expand Down

0 comments on commit ea0f04a

Please sign in to comment.