LightningWar
LightningWar

Reputation: 975

Get-WebBinding - Class Alternative

I'm having an issue using Get-Website and Get-WebBinding inside a workflow.

Get-Website -Name 'Default Web Site'

Returns the exception: Get-Website : Object reference not set to an instance of an object.

A solution is to use: Get-ChildItem "iis:\sites".

My question: is there an alternative way to return the properties of Get-WebBinding and bypass this exception? Or does someone know how to fix this error?

Thanks

Upvotes: 1

Views: 222

Answers (1)

Manu
Manu

Reputation: 1742

You can use InlineScript inside the workflow :

InlineScript { Get-Website -Name 'Default Web Site' }

About InlineScript :

"The InlineScript activity runs commands in a shared Windows PowerShell session. You can include it in a workflow to run commands that share data and commands that are not otherwise valid in a workflow."

Upvotes: 1

Related Questions