edge-ps icon indicating copy to clipboard operation
edge-ps copied to clipboard

multiple arguments

Open wagosia opened this issue 12 years ago • 3 comments

$inputFromJS allows to pass just one argument to Powershell, how can we pass multiple arguments ?

I have tried following and it works but is there better way ?

 var eventlog = edge.func('ps', function() {/*
    $PARAM = "$inputFromJS" | ConvertFrom-Json;
    Get-EventLog -LogName $PARAM.logname -Newest $PARAM.limit | ConvertTo-Json
 */});

 app.get('/api/v1.0/eventlog/:logname/:limit', function(req, res) {

    var test = {};
    test.limit = req.params.limit || 100;
    test.logname = req.params.logname

    eventlog( JSON.stringify(test) , function (error, result) {
        if (error) throw error;
        res.send(result[0]);
    });
 });

wagosia avatar Aug 10 '13 14:08 wagosia

Great question. I have some ideas. I'll let you know.

dfinke avatar Aug 10 '13 20:08 dfinke

I'm curious of the same thing. Any update on this?

chris-neely avatar Apr 12 '16 02:04 chris-neely

I used this method and it works great. It would be nice to be able to pass an object and have this happen automatically. Or at least use this as a documented solution.

AshMartian avatar Oct 21 '16 17:10 AshMartian