Get-WebConfiguration: Commit Path contains one or more invalid characters

Welcome Forums General PowerShell Q&A Get-WebConfiguration: Commit Path contains one or more invalid characters

This topic contains 3 replies, has 2 voices, and was last updated by

 
Participant
1 year, 6 months ago.

  • Author
    Posts
  • #69004

    Participant
    Points: 1
    Rank: Member

    I am trying to enumerate through a number of web sites defined on an IIS server and get some configuration information on that site. However whenever it encounters a website with a parenthesis it gives the following error.

    Get-WebConfiguration : Commit path contains one or more invalid characters.

    My Google-fu is failing me.

    Any thoughts as to why this might be. I have tried encoding the parenthesis but to no avail.

  • #69385

    Keymaster
    Points: 1,644
    Helping HandTeam Member
    Rank: Community Hero

    Yeah, that's kind of a thing with IIS and is basically a bug in the module. The answer is, "don't use parentheses in site names."

  • #69451

    Participant
    Points: 1
    Rank: Member

    I was afraid that would be the response. 🙁

    Thanks, Don.

  • #70017

    Participant
    Points: 1
    Rank: Member

    I found a workaround for this issue. Instead of using the Get-WebConfiguration cmdlet, you need to use the Get-WebConfigurationProperty cmdlet.

    So instead of using

    Get-WebConfiguration "/system.webServer/security/dynamicIpSecurity/denyByConcurrentRequests" -PSPath "IIS:\Sites\somesitename"

    You can use

    Get-WebConfigurationProperty -filter "/system.webServer/security/dynamicIpSecurity/denyByConcurrentRequests" -PSPath "IIS:\Sites\somesitename" -name "*"

The topic ‘Get-WebConfiguration: Commit Path contains one or more invalid characters’ is closed to new replies.