Do PowerShell scripts run under Mono?

2019-01-24 01:34发布

问题:

Do PowerShell scripts run under Mono? I would like to run them on a Mac.

回答1:

There is an open source version of PowerShell called Pash designed for Mono. It is not complete, but may be able to do what you need:

http://pash.sourceforge.net/ (this project has not been active for quite some time)

Checkout the re-start at: Pash-Project on GitHub.



回答2:

Powershell has now been open-sourced and is available here.

As of right now it is V6.0 alpha. I've been running it on OS X for a lot of file operations and it has been working very well.

Note that you may need to install .Net Core to get Powershell to behave properly. Also note that system.management.automation.runspaces works right out of the box (for runspacepools).



回答3:

The powershell.exe stub is actually a native win32 program, not a managed assembly. It may be possible in the future to host the System.Management.Automation assembly in Mono, but I'm fairly sure it doesn't work at the moment.