Single command
from virtualshell import Shell with Shell() as sh: r = sh.run("Get-Process | Select-Object -First 1 Name") assert r.success
Batch
from virtualshell import Shell with Shell() as sh: rs = sh.run(["Get-Date", "Get-Random", "Get-Location"]) # List[ExecutionResult] for r in rs: if not r.success: print("failed:", r.err)
There was an error while loading. Please reload this page.