Sometimes we fall into a situation when we had to add items to SharePoint list through power shell script. Power shell script can be run only when we have access to the server. But what if we had to run the script without server access???
PnP Power shell comes for the rescue!
PnP Power shell can be used to connect to the SharePoint site and perform the operations.
Connect to a SharePoint site:
Connect-PnPOnline –Url "SiteURL" –Credentials (Get-Credential)
Get list:
$items =Get-PnPListItem -List "Listname"
List operations:
Add-PnPListItem -List "Listname" -Values @{"Columnname"="Value"}
Set-PnPListItem -List "Listname" -Identity itemid -Values @{"Columnname"="Value"}
Remove-PnPListItem -List "Listname" -Identity itemid -Force
PnP Power shell comes for the rescue!
PnP Power shell can be used to connect to the SharePoint site and perform the operations.
Connect to a SharePoint site:
Connect-PnPOnline –Url "SiteURL" –Credentials (Get-Credential)
Get list:
$items =Get-PnPListItem -List "Listname"
List operations:
Add-PnPListItem -List "Listname" -Values @{"Columnname"="Value"}
Set-PnPListItem -List "Listname" -Identity itemid -Values @{"Columnname"="Value"}
Remove-PnPListItem -List "Listname" -Identity itemid -Force
Comments
Post a Comment