Can you run a UserCustomAction with Powershell? I am planing to automate a process and this is the easiest way.
-
sharepoint online or on prem?Waqas Sarwar MVP– Waqas Sarwar MVP ♦2018-10-31 10:52:21 +00:00Commented Oct 31, 2018 at 10:52
-
sharepoint on-premJoshua Dominic Sibug– Joshua Dominic Sibug2018-10-31 10:57:30 +00:00Commented Oct 31, 2018 at 10:57
-
do you want to deploy/add a custom action using PS ? sorry i didnt understand :(Gautam Sheth– Gautam Sheth2018-10-31 12:08:09 +00:00Commented Oct 31, 2018 at 12:08
-
I wan to run it, as if I am calling a functionJoshua Dominic Sibug– Joshua Dominic Sibug2018-11-01 02:54:31 +00:00Commented Nov 1, 2018 at 2:54
Add a comment
|
1 Answer
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()
-
Why is this upvoted? OP asked for a way to RUN it, not a way to add it to a list.Arg0n– Arg0n2019-11-21 10:47:41 +00:00Commented Nov 21, 2019 at 10:47