How can I get a specific value from this powershell cmdlet?


This should be a quick one. I am running this command:

Get-WebConfiguration -pspath ‘MACHINE/WEBROOT/APPHOST’ -filter ‘system.webServer/security/requestFiltering/verbs/add’ | fl verb, allowed

This prints the following output:

verb : TRACE
allowed : False

verb : OPTIONS
allowed : False

From this, I want to get the allowed value for a specific verb. E.G. If I have a function that takes a string for the verb name, it will return the allowed value. I was playoing around with where etc but no luck.

When you post code, sample data, console output or error messages please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.

Thanks in advance

How to format code in <---- Click :point_up_2:t4: :wink:

You can filter the output with Where-Object to access specific objects.

Ahh figured it out now. :slight_smile:

Great. :+1:t4:

You may share your solution here with the world to help others comming here with the same or a similar issue. :wink: