I am new to writing scripts and am currently writing a script which will automate populating the contents of a web configuration file. However, every time I try to add a deny tag, it always populates it as an allow tag.
I am doing
Add-WebConfiguration '/system.web/authorization' -location 'Blue.aspx' -PSPath $path -value @{accessType='Deny';users='*'}
in my script, but the web config keeps populating as
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
I want it to appear as
<system.web>
<authorization>
<deny users="*" />
</authorization>
</system.web>
I have also been using this webpage for reference, but have not been able to find anything to help. I've tried a bunch of things to no avail. Any thoughts?