How to convert .cs file to a PowerShell cmdlet?

后端 未结 3 1116
离开以前
离开以前 2021-02-06 09:21

Can anyone help me to convert a C# .NET program to PowerShell cmdlet? I am very new to this area. Please help me to get out of this checkpoint!

Regards,

Arun

3条回答
  •  青春惊慌失措
    2021-02-06 09:23

    There's an add-on for Reflector to do that. Here's a good article with the example: http://msmvps.com/blogs/paulomorgado/archive/2009/09/18/powershell-for-the-net-developer.aspx*

    .NET Reflector has an array of add-ons on CodePlex, and one of these is the PowerShell add-on that allows you to disassemble code directly into PowerShell.

    In this example, I am opening the method ChangeAccountPassword from the SPUtility library in SharePoint:

    I can now change targets from C# to PowerShell.

    When you need to convert helper methods from C# to PowerShell or if you’re new to PowerShell syntax, this tool is really helpful!

    [*] The link is dead as of 10/12/2015.

提交回复
热议问题