Closed fpvmorais closed 2 months ago
Could you give me an example about how to use var in your provided ob-powershell.el? Because when I tested it with :var tmp="string"
, I got this error.
This works for me:
#+begin_src powershell :var tmp="Hello"
Write-Host $tmp
#+end_src
#+RESULTS:
: Hello
That's weird. What I have done is replacing the melpa version ob-powershell.el with the revised one. Seems like the replacement doesn't take effect.
Well you can try to use my fork of the code. This is what I am using:
(use-package ob-powershell
:straight (ob-powershell.el :type git
:repo "https://github.com/fpvmorais/ob-powershell.git";
:local-repo "ob-powershell")
:commands
(org-babel-execute:powershell
org-babel-expand-body:powershell))
#+begin_src powershell :var tmp="Hello"
Write-Host $tmp
#+end_src
#+RESULTS:
: Hello
If you're using Powershell core, you should also check the ob-pwsh (https://github.com/togakangaroo/ob-pwsh) It also lacks the variable stuff, but I added them on my fork: https://github.com/fpvmorais/ob-pwsh.git
After manually installing it, it works! Thx!
Hello,
@cbilson created this gist in 2018 and I've leater added support for variables in the code. My elisp-fu is not great and I'm not sure if this is the right way to do it, but I've been using this since 2019 and has served me well. It seems you have this published in Melpa. Would you be open for a pull request?