Page 1 of 1

PowerShell

Posted: Fri Oct 22, 2010 12:28 am
by WaltBrown
Hi!
Has anyone had any luck executing PowerShell from LC? I've tried three ways:

1. Setting Powershell to be the shellCommand, then using shell().
2. Using cmd.com to send "powershell xxx" commands using shell().
3. Using the open/write/read process process.

None seem able to close the PowerShell process once it is open (including "close process"), and none seem to get any response back in either "it" or "the result", except for "-?" help return. I sometimes get a partial return if I call up the Task Manager and kill the PowerShell process that way, but not if I interrupt LC with a ctrl-period.

Thanks,
Walt

Re: PowerShell

Posted: Tue Nov 02, 2010 2:49 pm
by Mark
Hi Walt,

Ask in a PowerShell forum how to turn your PowerShell script into a standalone executable.
Run executable directly from shell().

Best,

Mark

Re: PowerShell

Posted: Wed Nov 03, 2010 2:15 am
by WaltBrown
Ah, thanks Mark. I'll try that as well. My objective though was to make a PowerShell GUI in LC for my own use. I want to capture output, maintain a library of PS scripts and utilities.
Walt

Re: PowerShell

Posted: Thu Nov 04, 2010 1:44 am
by Mark
Walt,

PowerShell contains very many features that you can't run directly from within Revolution. That will probably make it very difficult to create a useful GUI for it.

Kind regards,

Mark

Re: PowerShell

Posted: Thu Nov 04, 2010 1:21 pm
by WaltBrown
Hi Mark,

What I was trying to do was open it as a process (I was reading about "open process" in LC), and then either use stdin and stdout to communicate (using -NoExit and -NonInteractive switches) with it, or launch it each time I had a command. I'm still experimenting. My main goal is figuring out how to successfully use "open process", PowerShell is just the "victim"...

Walt