PowerShell

Deploying to Windows? Utilizing VB Script execution? This is the place to ask Windows-specific questions.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
WaltBrown
Posts: 466
Joined: Mon May 11, 2009 9:12 pm

PowerShell

Post by WaltBrown » Fri Oct 22, 2010 12:28 am

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
Walt Brown
Omnis traductor traditor

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: PowerShell

Post by Mark » Tue Nov 02, 2010 2:49 pm

Hi Walt,

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

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

WaltBrown
Posts: 466
Joined: Mon May 11, 2009 9:12 pm

Re: PowerShell

Post by WaltBrown » Wed Nov 03, 2010 2:15 am

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
Walt Brown
Omnis traductor traditor

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: PowerShell

Post by Mark » Thu Nov 04, 2010 1:44 am

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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

WaltBrown
Posts: 466
Joined: Mon May 11, 2009 9:12 pm

Re: PowerShell

Post by WaltBrown » Thu Nov 04, 2010 1:21 pm

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
Walt Brown
Omnis traductor traditor

Post Reply