Search code examples
pythonpowershellscripting-language

Passing objects from python to powershell


I want to have an integration between my python scripts and my powershell scripts. For that I need the option to pass object of class I made so powershell could work with it.

That class contains string type properties and one object property that contains None or a pointer to object of another classes I made that contains only string properties.

What is the best way to do that task? Thanks.


Solution

  • The easiest might be to encode the object as a JSON string in Python, and then convert it to a PowerShell object with ConvertFrom-Json.