1

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.

Nirendy
  • 58
  • 7

1 Answers1

0

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.

dan-gph
  • 16,301
  • 12
  • 61
  • 79
  • What is the right way to encode all of my classes to JSON? Is there a python library that does it like powershell has? – Nirendy Mar 11 '15 at 14:13
  • @user3482697, Python has very good documentation. Why don't you look in the Python Library Reference? – dan-gph Mar 11 '15 at 14:20