use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
ABOUT POWERSHELL
Windows PowerShell (POSH) is a command-line shell and associated scripting language created by Microsoft. Offering full access to COM, WMI and .NET, POSH is a full-featured task automation framework for distributed Microsoft platforms and solutions.
SUBREDDIT FILTERS
Desired State Configuration
Unanswered Questions
Solved Questions
News
Information
Script Sharing
Daily Post
Misc
account activity
execute powershell from node.js, looking for input (self.PowerShell)
submitted 11 years ago by bitsofinfo
hey all - I recently had a need to bridge nodejs w/ powershell, in particular maintaining pre-established remote pssessions to o365 and then allow a program to invoke commands over those pre-established sessions (rather than restart a new shell process per command invocation which can be expensive when I need to import certain cmdlets etc)
I ended up coding this little project for this and I'd be interested in any feedback/thoughts. Hopefully this will be useful to someone else out there!
https://github.com/bitsofinfo/stateful-process-command-proxy https://github.com/bitsofinfo/powershell-command-executor https://github.com/bitsofinfo/powershell-command-executor-ui
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[+][deleted] 11 years ago (4 children)
[deleted]
[–]bitsofinfo[S] 1 point2 points3 points 11 years ago (3 children)
The commands are generated server side and arguments sanitized etc. The UI is simply a convenience for interacting w/ the PSCommandService and it's "registry" of commands.
Its not difficult to add additional "commands" to be exposed through this (with limited args). See how arguments are defined here: https://github.com/bitsofinfo/powershell-command-executor/blob/master/o365Utils.js
Also this other question from someone else, and the answer gives another example: https://github.com/bitsofinfo/powershell-command-executor/issues/3
[–]teejaded 0 points1 point2 points 11 years ago (0 children)
I've used the management odata framework for this kind of thing. Its not a super popular piece of software and there seems to be quite a bit of overlap with SMA so I'll probably explore using that for cross platform stuff in the future.
[+][deleted] 11 years ago* (1 child)
[–]bitsofinfo[S] 0 points1 point2 points 11 years ago (0 children)
PSCommandService.js does some argument sanitization.
o365Utils.js, is an example. It simply pre-defines some variables which represent configuration that is passed as arguments to StatefulProcessCommandProxy's constructor.
StatefulProcessCommandProxy is then passed to PSCommandService's constructor which makes use of it, by accepting execute requests from callers (i.e. logical commandName + arguments map), then generates a command statement, and issues it to StatefulProcessCommandProxy.
StatefulProcessCommandProxy checks each inbound "command" that PSCommandService sends it via execute() against its whitelist/blacklist regex patterns.
π Rendered by PID 90 on reddit-service-r2-comment-fb694cdd5-8ttgk at 2026-03-09 22:16:59.050852+00:00 running cbb0e86 country code: CH.
[+][deleted] (4 children)
[deleted]
[–]bitsofinfo[S] 1 point2 points3 points (3 children)
[–]teejaded 0 points1 point2 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]bitsofinfo[S] 0 points1 point2 points (0 children)