Hi anonymous user,
Try to add "-eq $null" as follows:
if($webpubfeature.DefinitionId -eq $null)
If the site has a publishing function activated, the site URL will be output.
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.