$site = "https://{tenant}.sharepoint.com/sites/{site}" | |
Connect-PnPOnline -Url $site -SPOManagementShell -ClearTokenCache | |
$field = "Promoted State" | |
$list = "Site Pages" | |
$id = 85 #the item id of the news | |
Set-PnPField -Identity $field -List $list -Values @{ReadOnlyField=$false} | |
#make sure to enclose the number into quotation marks | |
Set-PnPListItem -List $list -Identity $id -Values {"Promoted State"="0"} | |
#reset the field | |
Set-PnPField -Identity $field -List $list -Values @{ReadOnlyField=$true} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment