Automation of PowerShell from Delphi? -


can powershell automated? i.e. there com interface powershell can imported delphi type-library interface automate it, , if so, relevant file name(s)?

googling, etc, i've found numerous references automating things within powershell script, haven't been able find whether or not control powershell via com it ms word or whatever, , maybe receive events it. i'm wanting hand command within delphi app execute arbitrary cmdlet , status information while it's executing script (otherwise i'd make doing shellexecute on it).

i'm not sure whether fact have been able find because powershell design not automatable or because haven't managed frame effective query filters out automation can done using powershell script host.

this using xe8 on win7 64-bit or win10 upgrade, btw.

elaborating on raelb's suggestion of http://delphidabbler.com/software/consoleapp:

this worked me since powershell can run console app. if wanted run cmdlet "abc -param", call execute method of tpjconsoleapp instance:

app.execute ('powershell -command abc -param')

peter johnson (delphidabbler) provides several examples interacting console app via pipes, files, etc. status information cmdlet's stdout (stdin , stderr available). working code can derived appropriate example.

optionally may want provide additional parameters powershell:

https://msdn.microsoft.com/en-us/powershell/scripting/core-powershell/console/powershell.exe-command-line-help


Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -