Skip to content
This repository has been archived by the owner on Aug 24, 2021. It is now read-only.

Set-PnPListItem  #1903

Closed
elazar-b opened this issue May 24, 2020 · 2 comments
Closed

Set-PnPListItem  #1903

elazar-b opened this issue May 24, 2020 · 2 comments

Comments

@elazar-b
Copy link

elazar-b commented May 24, 2020

####Which PnP repository should you use to report the issue?####
PnP PowerShell - https://github.com/OfficeDev/PnP-PowerShell

Category

[ X] Bug
[ ] Enhancement

Environment

[X ] Office 365 / SharePoint Online
[ ] SharePoint 2016
[ ] SharePoint 2013

If SharePoint on-premises, what's exact CU version:

Expected or Desired Behavior

Set-PnPListItem -List "test" -Identity $ConnectToSPs.Id -Values @{"Status" = "Failed" }
When requesting status change on page SharePoint

Observed Behavior

format-default : The collection has not been initialized. It has not been requested or the request has not been executed. It may need to be
explicitly requested.

Steps to Reproduce

Connect-PnPOnline -Url ........

$ConnectToSPs = Get-PnPListItem -List "test" | Where-Object { ($_)["Status"] -eq "Waiting" }
set-mailbox ......etc

Set-PnPListItem -List "test" -Identity $ConnectToSPs.Id -Values @{"Status" = "Failed" }

error :
format-default : The collection has not been initialized. It has not been requested or the request has not been executed. It may need to be
explicitly requested.

@FranckyC
Copy link
Member

Hi @elazar-b, this is a more PowerShell issue. Just catch the cmdlet result in a variable like $item = Set-PnPlistItem. Maybe this article could help.

@elazar-b
Copy link
Author

Thanks a lot - the solution helped

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants