Office 365 – PnP PowerShell – The object is used in the context different from the one associated with the object

Get Field names from a list Today I tried to load the Fields from a list using PnP PowerShell and CSOM. [code lang=text] $ctx = Get-PnPContext $list = Get-PnPList -Web $web -Identity $listName $ctx.Load($list.Fields) $ctx.ExecuteQuery() [/code] This quite quickly resulted in : Exception calling "Load" with "1" argument(s): "The object is used in the context … Continue reading Office 365 – PnP PowerShell – The object is used in the context different from the one associated with the object

Advertisements

SharePoint Online PnP – The object is used in the context different from the one associated with the object.

Today  one of my colleagues was trying to create a list item in SharePoint Online using the PnP PowerShell. Adding an item to a list He was running the following command [code lang=text] Add-PnPListItem -List $dlist -Values @{"Title" = "$webTitle"} [/code] and got the following error: [code lang=text] Add-PnPListItem : The object is used in … Continue reading SharePoint Online PnP – The object is used in the context different from the one associated with the object.