1

can you tell me if it's possible to use a powershell script that would be used with a webpart component, as we can do with javascript scripts?

2 Answers 2

0

I'm not sure if I anderstand it right. But powershell is for scripting on the server. With powershell you can for example acces to to webparts and change their parameters from server console (shell, PowerShell ISE console).

May be you are asking about codebehind c# code, which you can use on on premis SharePoint (not in Sharepoint online).

I'm afraid you can't use powershell in webpart, but you can use c#, if you are developing your webPart.

0

If you're asking about running a PowerShell script from server-side of a Web part, that is technically possible but not recommended.
Here's how you can do it (you'll find a lot of articles on the subject on the Web): http://blogs.msdn.com/b/kebab/archive/2014/04/28/executing-powershell-scripts-from-c.aspx or https://stackoverflow.com/questions/11120452/run-powershell-script-from-c-sharp-application.

If your point is about running PS scripts on the client-side, this is not possible.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.