Search code examples
command-line-interfacegraphvizpowershell-5.1

run a cmd command from powershell script


I am trying to run a program called Graphviz in the later stage of a PowerShell script I have to collect and create employee information to make an orgchart

script located here

in windows command prompt (cmd) it would be executed as like this

Create an SVG from DOT file:

dot -Tsvg -o path/to/out_file.svg path/to/file.dot

I may be overthinking this but I don't know how to execute a program in PowerShell with arguments

Thank you in advance

(comments on my script are welcome)


Solution

  • Adding double quotes to your script worked for me:

    cmd.exe \c "C:\Program Files\Graphviz\bin\dot.exe" -Tdot abc.gv