powershellhaxeneko

How to run a powershell script from neko haxe?


I need to run a powershell script from haxe code and return data. I will use this data in my code.

How I can do this?


Solution

  • You can run a sys.io.Process from Neko.

    Check out the api docs
    http://api.haxe.org/sys/io/Process.html

    To see an example of how to use it, check this
    http://code.haxe.org/category/macros/add-git-commit-hash-in-build.html

    In your case it would look like this

    var process = new sys.io.Process('powershell', ['any parameters']);
    

    Note: I'm not sure if you really need powershell since you can execute stuff commandline with this.

    I hope this helps!