PnP issue on SPO DocumentSet

%3CLINGO-SUB%20id%3D%22lingo-sub-632615%22%20slang%3D%22en-US%22%3EPnP%20issue%20on%20SPO%20DocumentSet%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-632615%22%20slang%3D%22en-US%22%3E%3CP%3EHi%3C%2FP%3E%3CP%3EI%20am%20struggeling%20with%20an%20PnP%20issue%20on%20Documents%20Sets.%20I%20need%20to%20update%20the%20property%20values%20on%20the%20Document%20Set%20shared%20properties%20as%20well%20as%20properties%20in%20documents%20(with%20different%20content%20types)%20inside%20the%20Document%20Set%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20tried%20somthing%20like%20this%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%24docs%20%3D%20Get-PnPListItem%20-web%20%24subsiteurl%20-List%20%24TargetListID%3C%2FP%3E%3CP%3Eforeach%20(%24item%20in%20%24docs)%7B%3C%2FP%3E%3CP%3E%24spfile%20%3D%20Set-PnPListItem%20-List%20%24TargetListID%20-Identity%20%24item.Id%20-Values%20%40%7B%22xx%22%3D%22%24xx%22%7D%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CBR%20%2F%3E%24spfile%20%3D%20Set-PnPListItem%20-List%20%24TargetListID%20-Identity%20%24item.Id%20-Values%20%40%7B%22yy%22%3D%22%24yy%22%7D%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CBR%20%2F%3Eetc%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20do%20get%20the%20List%2Fibrary%20items%20including%20the%20Document%20Set%20folder%2C%20but%20it%20is%20NOT%20able%20to%20Set-PnPListItem%20values%2C%20I%20get%20no%20errors%20when%20running%20the%20powershell%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20did%20this%20on%20SP2013%20on-premise%20with%20no%20problem%20like%20this%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%24weburl%20%3D%20%24_%5B'TargetSiteURL'%5D%3CBR%20%2F%3E%24web%20%3D%20Get-SPWeb%20-Identity%20%24weburl%3CBR%20%2F%3E%24list%20%3D%24web.lists%5B%22TagetlistName%22%5D%3C%2FP%3E%3CP%3Eforeach(%24item%20in%20%24list.folders)%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CBR%20%2F%3E%7B%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CBR%20%2F%3E%24item%5B%22xx%22%5D%3D%24_%5B'xx'%5D%3CBR%20%2F%3E%24item%5B%22yy%22%5D%3D%24_%5B'yy'%5D%3CBR%20%2F%3Eetc%3C%2FP%3E%3CP%3E%24item.update()%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPlease%20Post%20if%20you%20have%20a%20hint%20to%20a%20solution...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EAnyone%20with%20input%20%3A)%3C%2Fimg%3E%20%3F%3F%20much%20appreciated%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%2F%20MBNielsen%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-632615%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EPnP%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Visitor

Hi

I am struggeling with an PnP issue on Documents Sets. I need to update the property values on the Document Set shared properties as well as properties in documents (with different content types) inside the Document Set

 

I tried somthing like this:

 

$docs = Get-PnPListItem -web $subsiteurl -List $TargetListID

foreach ($item in $docs){

$spfile = Set-PnPListItem -List $TargetListID -Identity $item.Id -Values @{"xx"="$xx"} 
$spfile = Set-PnPListItem -List $TargetListID -Identity $item.Id -Values @{"yy"="$yy"} 
etc

 

I do get the List/ibrary items including the Document Set folder, but it is NOT able to Set-PnPListItem values, I get no errors when running the powershell

 

I did this on SP2013 on-premise with no problem like this:

 

$weburl = $_['TargetSiteURL']
$web = Get-SPWeb -Identity $weburl
$list =$web.lists["TagetlistName"]

foreach($item in $list.folders) 
{ 
$item["xx"]=$_['xx']
$item["yy"]=$_['yy']
etc

$item.update()

 

Please Post if you have a hint to a solution...

 

Anyone with input :) ?? much appreciated

 

/ MBNielsen

 

0 Replies