Dominic Brunetti
Dominic Brunetti

Reputation: 1069

get-webbinding -like IIS:\Sites\$variable

I have a script that does a get-webbinding and it works fine. However, I need to do something like the following:

$Binding = Get-WebBinding -like $variable

So for example, $variable would be website, but the IIS website would be called website.com. I need it to do a like comparison, but cannot figure out how to do that. I appreciate any advice.

Upvotes: 0

Views: 384

Answers (1)

postanote
postanote

Reputation: 16126

Try this...

$SiteName = 'SiteName'
(Get-WebBinding | 
Where bindingInformation -like "*$SiteName*").bindingInformation

Upvotes: 1

Related Questions