Sharepoint - Where-Object in Powershell
there is small mistake in your code. there should be a "." after '$_". try this
Get-SPsite | where {$_.Url -eq "http://Rany1/xxx"}
And just to add to the list of options, you can also replace Where-Object
and where
with a little question mark ?
.
Get-SPsite | ?{$_.Url -eq "http://Rany1/xxx"}
Reference: Where-Object
Get-PNPSite | where-Object {$_["Url"] -eq "http://rany1/xxx"}