Reputation: 81
So, I made a Python file (.py) and I want to convert it into a PowerShell file (.ps1)
I tried this tool: https://github.com/x-j/ps1scriptify but every time I give it a .py file, it says:
Python script provided is not callable (does not contain a main block)
So I changed this: print("Hello, World")
to this:
def main():
print("Hello, world")
main()
It still gives me the same error mentioned above.
Any help please?
Upvotes: 0
Views: 1597
Reputation: 8605
That conversion script is expecting to see a block like
if __name__ == '__main__':
main()
so pop that into your script instead of just the raw call to main()
.
Upvotes: 1