SharePoint PowerShell - How to get list item by ID using GetItemById


How to get SPListItem via PowerShell using GetItemById()

Use below PowerShell command to retrieve SharePoint List Item using the Item ID. This uses GetItemById() which takes in the ItemId as a parameter.

You can modify the below code for other requirements but the core logic remains the same.

Name : Get SharePoint ListItem using GetItemById()
$web = Get-SPWeb <SITE URL>
$list = $web.GetList("<LIST NAME>")
$list.GetItemById(<ITEM ID>)

where,

SITE URL = URL of SharePoint Site (string)

LIST NAME = Name of SharePoint List (string)

ITEM ID = Number of Item Id (integer)

|ADsADsAdss|