edge-ps
edge-ps copied to clipboard
multiple arguments
$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]);
});
});
Great question. I have some ideas. I'll let you know.
I'm curious of the same thing. Any update on this?
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.