-
Notifications
You must be signed in to change notification settings - Fork 6
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
Getting an error when trying to run some examples #7
Comments
Thanks for trying Stefan. I'll get back to you shortly after I investigate. |
Thnx -----Original Message----- Thanks for trying Stefan. I'll get back to you shortly after I investigate. Reply to this email directly or view it on GitHub: |
Ok, sorry about that. I was in the middle of spiking out some ideas and checked them in. This version spins up a web server and serves up PowerShell files. So... Try this
Then launch a browser and use this url
You should get this
You can see that it is executing test.ps1. It can also take two parameters like this.
You can create your own PowerShell files. Save them in the edge-powershell\samples\tryPowerShell directory. You execute it with the base url
Then the base name of the file without the ps1 extension.
Passing parameters follow the query string convention
I'm working towards merging the solution where you can run this as standalone or through a web server. |
Installed Express and set $env:PORT to an available port and it worked as expected. So, I created this script.
It throws an error
Simple scripts like "1..3" work. Maybe this has something to do with #6. If I pipe to
|
I believe it may work if you pipe it to Out-String |
Yes, that works as well as ConvertTo-JSON, but like you said, that's just a big string, not an object. |
Yep, so getting an "object" back is the challenge. I'm not sure how, I have some guesses. I'm wondering if/how PowerShell Web Access does it. |
When I run the following from the samples folder I get the following error:
D:\Install\Node\edge-powershell-master\samples\tryPowerShell> node .\test.js
D:\Install\Node\edge-powershell-master\samples\tryPowerShell\test.js:16
if (error) throw error;
^
System.AggregateException: One or more errors occurred. ---> System.InvalidCastException: Unable to cast object of type
'System.String' to type 'System.Collections.Generic.IDictionary
2[System.String,System.Object]'. at Edge.PS.EdgePowerShell.<InvokeScript>d__2.MoveNext() in d:\Install\Node\edge-powershell-master\src\Edge.PowerShell \Edge.PowerShell\EdgePowerShell.cs:line 36 --- End of inner exception stack trace --- ---> (Inner Exception #0) System.InvalidCastException: Unable to cast object of type 'System.String' to type 'System.Col lections.Generic.IDictionary
2[System.String,System.Object]'.at Edge.PS.EdgePowerShell.d__2.MoveNext() in d:\Install\Node\edge-powershell-master\src\Edge.PowerShell
\Edge.PowerShell\EdgePowerShell.cs:line 36<---
What am I doing wrong?
I've installed Node.js 0.8.19 and Edge.
/Stefan
The text was updated successfully, but these errors were encountered: