O365 Custom JavaScript Injection using PowerShell
Custom action fetches an external script and includes it in the page. So at run time the script will self execute as an anonymous function.
Fulfilling God's purpose for my life
A collection of 28 posts
Custom action fetches an external script and includes it in the page. So at run time the script will self execute as an anonymous function.
Continuation to How to use taxonomy hidden field article?
Using the below PowerShell commands we can open a page and trigger the click event written inside the page. I am using ListItemCollectionPosition to run the while based on the ROW Limit configured in the CAML query.
```powershell Add-Type -AssemblyName System.Web
Are you looking for an example code to execute CSharp code from PowerShell?
```powershell Add-PSSnapin Microsoft.SharePoint.Powershell
```powershell Add-PSSnapin “Microsoft.SharePoint.Powershell” -ErrorAction SilentlyContinue $sourceWebURL = “http://srcurl” $sourceListName = “Source” $destinationWebURL = “http://desurl” $destinationListName = “Destination” $spSourceWeb = Get-SPWeb $sourceWebURL $spDestinationWeb = Get-SPWeb $destinationWebURL $spSourceList = $spSourceWeb.Lists[$sourceListName] $spDestinationList = $spDestinationWeb.Lists[$destinationListName] $RootFolder = $spDestinationList.RootFolder $spSourceItems = $spSourceList.Items
```powershell Add-PSSnapin Microsoft.SharePoint.PowerShell -EA SilentlyContinue $FilePathCSV = import-csv Book1.csv $webURL = “http://url” $listName = “CSVInput” $web = Get-SPWeb $webURL $list = $web.Lists[$listName]