Adding Application Settings to a web site

Welcome Forums Web Site Feedback & Assistance Adding Application Settings to a web site

This topic contains 1 reply, has 2 voices, and was last updated by

 
Senior Moderator
1 week, 3 days ago.

  • Author
    Posts
  • #175090

    Participant
    Topics: 1
    Replies: 0
    Points: -8
    Rank: Member

    Hello,

    I have been working on trying to get PowerShell to add information to the "Application Settings" for a web site.  For the last week, I have been looking into this but there is not a lot of information on adding the information to the section.

    I have been able to list out all the values:

    Get-WebConfigurationProperty -pspath 'IIS:\Sites\Default Web Site' -filter "/appSettings/add" -name * | ft

    I have been able to change a value:

    Set-WebConfigurtionProperty -pspath 'IIS:\Sites\Default Web Site' -filter "/appSettings/add[@key='MyValue']" -name value -Value '1'

    But I have not been able to get the Add-WebConfigurtionProperty to allow a key and value to be placed in the site.  I have tried many different ways to get this to work and looked for references for the Add-WebConfigurationProperty dealing with the key and values but I have not found anything has gotten me over the hump.

    Thank you.

  • #175342

    Senior Moderator
    Topics: 8
    Replies: 1041
    Points: 3,438
    Helping Hand
    Rank: Community Hero

    Can you share us the code you attempted. This will help us in understand better. May be it could be a small miss somewhere.

You must be logged in to reply to this topic.