Forum Discussion
PowerShell examples - Get-SPOList and Get-SPOListItems
Hi Daniel Westerdale, Dean_Gross
Sorry I missed something in my previous example.
this is the correct code:
$web = Get-SPOWeb
$lists = Get-SPOList -web $web
$list = $lists |where {$_.Title -eq "Sales list"}
$items = Get-SPOListItem -web $web -List $list
$items[1].FieldValues
Thanks, I might end up using that. I did something similar a while back but I thought I need to do
SPOExecute as we do for standard CSOM to populate our client side objects.
Anyway I digress, I intended to bring back some standard field for each list item with one line of PS code using a pipeline but it doesn't look like it
- Nov 17, 2016
The one line option :smileyhappy: :
(Get-SPOListItem -web (Get-SPOWeb) -List ((Get-SPOList -web (Get-SPOWeb))|where {$_.Title -eq "Sales list"}))[1].FieldValues
- Daniel WesterdaleNov 17, 2016Iron Contributor
Pieter Veenstra wrote:The one line option :smileyhappy: :
(Get-SPOListItem -web (Get-SPOWeb) -List ((Get-SPOList -web (Get-SPOWeb))|where {$_.Title -eq "Sales list"}))[1].FieldValues
Thanks - I like it but I have discoved the same issue as I have my code snippet
I need those names for auditing purposes
Id Name Modified Author -- ---- -------- ------ 24 24_.000 17/11/2016 14:44:39 Microsoft.SharePoint.Client.FieldUserValue 25 25_.000 17/11/2016 15:01:47 Microsoft.SharePoint.Client.FieldUserValue 27 27_.000 17/11/2016 14:47:39 Microsoft.SharePoint.Client.FieldUserValue
- Nov 17, 2016
to get the Author details you could do this:
(Get-SPOListItem -web (Get-SPOWeb) -List ((Get-SPOList -web (Get-SPOWeb))|where {$_.Title -eq "Sales list"}))[1].FieldValues.Author
(Get-SPOListItem -web (Get-SPOWeb) -List ((Get-SPOList -web (Get-SPOWeb))|where {$_.Title -eq "Sales list"}))[1].FieldValues.Author.Email
(Get-SPOListItem -web (Get-SPOWeb) -List ((Get-SPOList -web (Get-SPOWeb))|where {$_.Title -eq "Sales list"}))[1].FieldValues.Author.LookupValue