Forum Discussion
PowerShell examples - Get-SPOList and Get-SPOListItems
Does anyone have any suggestions about where i can find some good examples using the pnp Get-SPOList and Get-SPOListItems cmdlets? The examples in github are very basic and I'm struggling with the best way to get field values so that i can use them in other commands.
not being able to search the old yammer forum is very frustrating (:
14 Replies
- Hi Dean_Gross - Have a look at this: - What are you trying to do? - the basic examples are: - $web = Get-SPOWeb - $lists = Get-SPOList -web $web - $list = $lists['ListName'] - $listitems = Get-SPOListItem -web $web -list $list - Dean_GrossSilver ContributorThanks, i just trying to read some values from a list so that I can use them to create some new site collections. The fields are getting returned without any values, 
 I tried the example from the above document, and I get the following
 Supply values for the following parameters:
 Title :
 Description :
 BaseTemplate ID :
 Created Date :
 List ID :
 ImageUrl :
 ItemCount :
 OnQuickLaunch :
 Other spo cmdlets seem to be working fine. I can't figure out what would be causing me to get no values.I figure out that i need to include \Lists\ in the listname parameter. Now I just need to figure out how to get the value out of a column that returns Microsoft.SharePoint.Client.FieldUrlValue I relearned that this can be done by using the following syntax $listItem["SPOUrl"].Url - Daniel WesterdaleIron Contributor
 Dean_Gross wrote:Thanks, i just trying to read some values from a list so that I can use them to create some new site collections. The fields are getting returned without any values, 
 I tried the example from the above document, and I get the following
 Supply values for the following parameters:
 Title :
 Description :
 BaseTemplate ID :
 Created Date :
 List ID :
 ImageUrl :
 ItemCount :
 OnQuickLaunch :
 Other spo cmdlets seem to be working fine. I can't figure out what would be causing me to get no values.I figure out that i need to include \Lists\ in the listname parameter. Now I just need to figure out how to get the value out of a column that returns Microsoft.SharePoint.Client.FieldUrlValue I relearned that this can be done by using the following syntax $listItem["SPOUrl"].Url Hi I have the same issue with the Author "Created By"column as this Client.FieldUserValue . I thought I could use but it doesn't quite work :smileymad: Get-SPOListItem $listName -Fields "FileLeafRef", "Modified", "Author" | %{new-object psobject -property @{Id = $_.Id; Name = $_["FileLeafRef"]; Modified = $_["Modified"]; Author = $_["Author"] }} | select Id, Name, Modified, AuthorI can see you have used another approach and probably get-spoContext