Running PowerShell from .NET Core

前端 未结 4 568
感动是毒
感动是毒 2020-12-09 08:18

Is there a way to run PowerShell scripts from .net-core ?

I\'m trying to run a PowerShell script in a new .net core \'website\\api\'. From what I can tell in order

4条回答
  •  情话喂你
    2020-12-09 09:04

    Although James Eby's answer is correct, there has been some new info that I found useful.

    There is now PowerShell Core available for cross-platform use. And it is open source!

    Here is some useful points from the article from Microsoft:

    PowerShell now officially supports macOS and Linux, including:

    • Windows 7, 8.1, and 10
    • Windows Server 2008 R2, 2012 R2, 2016
    • Windows Server Semi-Annual Channel
    • Ubuntu 14.04, 16.04, and 17.04
    • Debian 8.7+, and 9
    • CentOS 7
    • Red Hat Enterprise Linux 7
    • OpenSUSE 42.2
    • Fedora 25, 26
    • macOS 10.12+

    Logging

    On macOS, PowerShell uses the native os_log APIs to log to Apple's unified logging system. On Linux, PowerShell uses Syslog, a ubiquitous logging solution.

    SSH-based PowerShell Remoting

    The PowerShell Remoting Protocol (PSRP) now works with the Secure Shell (SSH) protocol in addition to the traditional WinRM-based PSRP. Source

    Breaking Changes link

提交回复
热议问题