Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Executing PowerShell code at the API level
#5
Set EXE outputPath %folders.ProgramFiles%\PowerShell\7

/*/ role exeProgram; outputPath %folders.ProgramFiles%\PowerShell\7; r %folders.ProgramFiles%\PowerShell\7\System.Management.Automation.dll; /*/
Furthermore, if the generated .exe is not located in the PowerShell 7 installation folder, how can we call the DLLs located in that folder?

Line 326 public class PS
https://github.com/p3nt4/PowerShdll/blob...on.cs#L326

The speed of executing PowerShell code at the API level is acceptable, and it's faster than executing Python.
So, I am looking forward to the following features. The data types in C# and PowerShell are compatible, which is much more convenient than using Python
-----------------------------------------
string var1="""
hello
world
""";

string var2="test.txt";
    
var R = ps.run("""
($var1 -split '\r?\n') -join '|' > $HOME\Desktop\$var2
'hello world'
""");

print.it($"Res: {R}");


Messages In This Thread
RE: Executing PowerShell code at the API level - by Davider - 03-18-2024, 10:29 PM

Forum Jump:


Users browsing this thread: 13 Guest(s)