Last active
July 15, 2024 09:25
-
-
Save dfinke/5182497 to your computer and use it in GitHub Desktop.
A PowerShell ISE Add on menu that runs Node.js against a JavaScript file opened in ISE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$sb = { | |
$node = "node.exe" | |
if(!(Get-Command $node -ErrorAction SilentlyContinue)) { | |
throw "Could not find $node" | |
} | |
$psISE.CurrentFile.Save() | |
& $node $psISE.CurrentFile.FullPath | |
} | |
$psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Add("Invoke Node", $sb, "CTRL+F6") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment