Skip to content

Instantly share code, notes, and snippets.

@dfinke
Last active July 15, 2024 09:25
Show Gist options
  • Save dfinke/5182497 to your computer and use it in GitHub Desktop.
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
$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