powershell - IF/ELSE Get-SPWeb -


i trying check whether web site exists. seem have error in if statement, i'm not sure of correct syntax. here's code:

$urlis = "https://ourdevsite.dev.com/sites/flibidyboots"  add-pssnapin microsoft.sharepoint.powershell -ea 0  if ((get-spweb $urlis) -ne 0){     write-host "site not exist, can proceed building it" -foregroundcolor green     } else { write-host "site exist, need pick url" -foregroundcolor red } 

what did wrong?

ok, first of $null, not 0. , second, if not $null exists, cases mixed up.


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -