문제

I have a Task owner column in SharePoint which is a Person or Group column. I am trying to check if this column is empty in Powershell

if($_["Task Owner"] -eq null)

This gives me the below error

you must provide a value expression following the '-eq' operator

Any help would be appreciated, TIA

도움이 되었습니까?

해결책

The issue is that PowerShell expects null value to be specified as $null,

In your case, this is the correct syntax:

if($_["Task Owner"] -eq $null)

다른 팁

My bad, I missed the $ in front of the null

It worked once I changed null to $null

if($_["Task Owner"] -eq $null)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top