0

Can you run a UserCustomAction with Powershell? I am planing to automate a process and this is the easiest way.

4
  • sharepoint online or on prem? Commented Oct 31, 2018 at 10:52
  • sharepoint on-prem Commented Oct 31, 2018 at 10:57
  • do you want to deploy/add a custom action using PS ? sorry i didnt understand :( Commented Oct 31, 2018 at 12:08
  • I wan to run it, as if I am calling a function Commented Nov 1, 2018 at 2:54

1 Answer 1

2

See your question isn't quite clear but userCustomactions are possible using the web object that powershell provides.

You can deploy it on a list or library.

 $web = get-spweb "http://exampleURL.com"
 $appType = $web.lists[$listTitle]
 $exampleAction = $appType.UserCustomActions.Add();

 $exampleAction.Url = "ExampleURL"
 $exampleAction.Location = "Ribbon.ListItem.Actions.Controls"

 $exampleAction.Title = "Give it a title"
 $exampleAction.Description  = "Give it a description"
 $exampleAction.Update()
1
  • Why is this upvoted? OP asked for a way to RUN it, not a way to add it to a list. Commented Nov 21, 2019 at 10:47

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.