Skip to content

Instantly share code, notes, and snippets.

@MSIH
Created May 11, 2016 14:37
Show Gist options
  • Save MSIH/ebf947980cb2643bf5d47a25860ef211 to your computer and use it in GitHub Desktop.
Save MSIH/ebf947980cb2643bf5d47a25860ef211 to your computer and use it in GitHub Desktop.
Check if SharePoint Web Application Exists based on Display Name
# if web application exists
$getSPWebApplication = Get-SPWebApplication | Where-Object {$_.DisplayName -eq $spAppName}
If ($getSPWebApplication -ne $null)
{
# do somehting if exists
}
else
{
write-host "Web Application does not exists"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment