调用 PowerShell

admin2021-10-26  1.3K+

import console;
import process.popen;

console.showLoading(" 请稍候,正在调用 PowerShell");
var prcs  = process.popen.ps(`-Command "& {Get-Command -Name *Process}"`);
var result = prcs.read(-1);

console.log(result);
console.pause();


也可以调用 .Net 然后调用 PowerShell :

import console;
import dotNet.ps;

console.showLoading(" 正在执行PowerShell命令");
console.log(dotNet.ps.command("Get-Command",{Name="*Process"}));

console.pause();
转载请注明原文地址: http://www.aardio.net/read-241.html
最新回复(0)
aardio问答
aardio编程语言