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

Powershell code execution #256

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

braheezy
Copy link

Fixes #229, partially? I didn't look at Command Prompt.

Changes Introduced

  • Allows ctrl+e to execute PowerShell code blocks
    • This required closing the temporary file immediately instead of deferring because slides blocks Windows from accessing the file
  • Test changes to support make test on different OS platforms

@@ -50,6 +51,10 @@ var Languages = map[string]Language{
Extension: "fish",
Commands: cmds{{"fish", "<file>"}},
},
Powershell: {
Extension: "ps1",
Commands: cmds{{"powershell", "-File", "<file>"}},

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Commands: cmds{{"powershell", "-File", "<file>"}},
Commands: cmds{{"powershell", "-NoLogo", "-NoProfile", "-File", "<file>"}},

You probably want to add NoLogoand NoProfile to make things faster and safer. I would also recommend using pwsh since that would work cross platform. I suspect the type of user who wants this tool would be using Pwsh.

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

Successfully merging this pull request may close these issues.

Support Windows CMD or PowerShell for code execution
2 participants