Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial outline for Windows powershell support. #8

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

RussellHaley
Copy link

"This implementation creates a new shell each execution, which is not ideal. TODO: figure out how to change shell once permanently (or does it always create a new shell?). TODO: Sanitize quotes for powershell as per in-code comment."

Hi, this is a first shot at adding powershell support as well as multi-shell support. Not mentioned in the comment is I changed it to use a home directory rather than /tmp for security reasons. The override is the set_temp function.

This is largely untested ("ls ~" worked!), but I thought I'd create a pull to get comments on an initial change. It's much more utilitarian than your code. I couldn't call commands through the meta mechanism to get the temp file set up (because there's no temp file!) so I used my existing library to bootstrap.

Also, while debugging I noted it went into the chuck to use the filepipe because args.input was "" (blank) not nil so I added a check for that.

It's late, probably missed details. Talk soon.
Russ

p.s. I have no interest in adding cmd support. :-P

…new shell each execution, which is not ideal. TODO: figure out how to change shell once permenantly (or does it always create a new shell?). TODO: Sanitize quotes for powershell as per in-code comment.
@tst2005
Copy link
Contributor

tst2005 commented Jan 24, 2018

Hello

Regards,

…hich is not lua freindly. My current solution is to script the command as verb__noun to replace the powershell verb-noun pattern using gsub. This works, but now we need a way of running managed assemblies from the command line. See pwr_sh.lua for the start of it. My idea is to pass a function instead of a string to sh.command(). upon execute, it will see it's a function and instead of appending arguments, pass the varargs in, and that gets added as the parameters.
Temporary fork note.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants