Converting C# to PowerShell

I found a great tip from Paulo Morgado around generating PowerShell from C# code.

.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:

image

I can now change targets from C# to PowerShell.

image

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

0 comments:

Post a Comment

Feel free to add your comment to this post. All comments are moderated and may not appear immediately within the page.