Quantcast
Viewing all articles
Browse latest Browse all 21070

how to filter webapplications from site collections when running get-spwebapplication $variable

Hi

I have a variable $variable that can be a site collection in the form (https://intranett) or can be a webapplication in the form ("mywebapplication").

When running the command 

get-spwebapplication $variable

it will returnes values even if it a site collection. What i want is that it only returns results if the variable is a webapplication.

Any ideas?

So far i'm at:

#Filter Webapplication, check if it is a webapplication
if(Get-spwebapplication $variable -ErrorAction SilentlyContinue)
{
$UnitSiZeLabeL.text = "This is indeed a Webapplication"
}

br

Bjorn



Viewing all articles
Browse latest Browse all 21070

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>