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

pshw starts with $error populated #114

Open
pcrosthwaite opened this issue Apr 5, 2020 · 0 comments
Open

pshw starts with $error populated #114

pcrosthwaite opened this issue Apr 5, 2020 · 0 comments

Comments

@pcrosthwaite
Copy link

Hi,

I'm trying the following code to run some powershell. It looks to me though that for some reason, when ps.invoke() is called, $error shows that there is a problem. Any ideas why?

const ps = new shell ({ executionPolicy: 'Bypass', noProfile: true, verbose: true})
ps.addCommand( "write-host $error.count")

ps.invoke().then(output => { console.log("test script finished")})

if i inspect the output, $error.count = 1, even though it hasn't done anything.

thanks for your help

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

No branches or pull requests

1 participant