{"action":"created","issue":{"url":"https://api.github.com/repos/rannn505/node-powershell/issues/39","repository_url":"https://api.github.com/repos/rannn505/node-powershell","labels_url":"https://api.github.com/repos/rannn505/node-powershell/issues/39/labels{/name}","comments_url":"https://api.github.com/repos/rannn505/node-powershell/issues/39/comments","events_url":"https://api.github.com/repos/rannn505/node-powershell/issues/39/events","html_url":"https://github.com/rannn505/node-powershell/issues/39","id":277118425,"number":39,"title":"node-powershell was unable to start powershell","user":{"login":"szeck87","id":8315038,"avatar_url":"https://avatars1.githubusercontent.com/u/8315038?v=4","gravatar_id":"","url":"https://api.github.com/users/szeck87","html_url":"https://github.com/szeck87","followers_url":"https://api.github.com/users/szeck87/followers","following_url":"https://api.github.com/users/szeck87/following{/other_user}","gists_url":"https://api.github.com/users/szeck87/gists{/gist_id}","starred_url":"https://api.github.com/users/szeck87/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szeck87/subscriptions","organizations_url":"https://api.github.com/users/szeck87/orgs","repos_url":"https://api.github.com/users/szeck87/repos","events_url":"https://api.github.com/users/szeck87/events{/privacy}","received_events_url":"https://api.github.com/users/szeck87/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2017-11-27T18:20:48Z","updated_at":"2018-03-06T17:25:57Z","closed_at":null,"author_association":"NONE","body":"I'm adding a feature to [Atom Beautify](github.com/Glavin001/atom-beautify) to support formatting PowerShell files/text using [PowerShell Beautifier](https://github.com/DTW-DanWard/PowerShell-Beautifier).  I came across this package to be able to run the PowerShell module needed for this to happen, however I'm running into this error: `Opss... node-powershell was unable to start PowerShell.  Please make sure that PowerShell is installed properly on your system, and try again.`, and a separate message: `'powershell' could not be spawned. Is it installed and on your path? If so please open an issue on the package spawning the process.` I'm on a Mac and have installed PowerShell via Homebrew.  Atom-Beautify is currently written in CoffeeScript, so the syntax is a little different but here is my code.  The relevant part is in the beautify function where it errors out on `ps = new shell()`.  It's all WIP (and just started)\r\n\r\n```\r\n\"use strict\"\r\nBeautifier = require('./beautifier')\r\nshell = require('node-powershell')\r\n\r\nmodule.exports = class PowerShellBeautifier extends Beautifier\r\n  name: \"powershell-beautifier\"\r\n  link: \"https://github.com/DTW-DanWard/PowerShell-Beautifier\"\r\n\r\n  options: {\r\n    PowerShell: false\r\n  }\r\n\r\n  beautify: (text, language, options) ->\r\n    ps = new shell()\r\n    tempFile = @tempFile(\"input\", text)\r\n    ps.addCommand(\"Set-PSRepository -Name PSGallery -InstallationPolicy Trusted\")\r\n    ps.addCommand(\"Install-Module -Name PowerShell-Beautifier\")\r\n    ps.addCommand(\"Edit-DTWBeautifyScript \" + tempFile)\r\n    ps.invoke().then(=> @readFile(tempFile)).catch(err => {})\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/rannn505/node-powershell/issues/comments/370860242","html_url":"https://github.com/rannn505/node-powershell/issues/39#issuecomment-370860242","issue_url":"https://api.github.com/repos/rannn505/node-powershell/issues/39","id":370860242,"user":{"login":"BenjaminMichael","id":8783702,"avatar_url":"https://avatars2.githubusercontent.com/u/8783702?v=4","gravatar_id":"","url":"https://api.github.com/users/BenjaminMichael","html_url":"https://github.com/BenjaminMichael","followers_url":"https://api.github.com/users/BenjaminMichael/followers","following_url":"https://api.github.com/users/BenjaminMichael/following{/other_user}","gists_url":"https://api.github.com/users/BenjaminMichael/gists{/gist_id}","starred_url":"https://api.github.com/users/BenjaminMichael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BenjaminMichael/subscriptions","organizations_url":"https://api.github.com/users/BenjaminMichael/orgs","repos_url":"https://api.github.com/users/BenjaminMichael/repos","events_url":"https://api.github.com/users/BenjaminMichael/events{/privacy}","received_events_url":"https://api.github.com/users/BenjaminMichael/received_events","type":"User","site_admin":false},"created_at":"2018-03-06T17:25:57Z","updated_at":"2018-03-06T17:25:57Z","author_association":"NONE","body":"Just wait for Rann to merge my PR it shouldn't take long since its 1.5 lines of changes"}}
{"actor":{"display_login":"BenjaminMichael"}}