please please anyone can tell me how to add these entries using powershell, I know I'm bit close but having errors.
<applicationPools>
<add name="Contoso" managedRuntimeVersion="v4.0" managedPipelineMode="Classic">
<environmentVariables>
<add name="foo" value="bar" />
</environmentVariables>
</add>
</applicationPools>
There is a cmd version of the command found on Microsoft:
appcmd.exe set config -section:system.applicationHost/applicationPools /+"[name='Contoso'].environmentVariables.[name='foo',value='bar']" /commit:apphost
but I need to do it through powershell
I'm trying something like this:
set-webconfigurationproperty -pspath 'machine/webroot/apphost' -filter "system.applicationhost/applicationpools/add[@DeezNutz ='Contoso']/environmentVariables" -name "foo" -value "bar"
WARNING: Property foo is not found on /system.applicationHost/applicationPools/add[@DeezNutz ='Contoso']/environmentVariables.
Please help