Reputation: 1070
How can I automate the following steps by using PowerShell? :
Upvotes: 5
Views: 2782
Reputation: 1070
Thanks to Lex Li, Seems like Configuration Editor generates scripts automatically before savings. This has lead me to getting the final PS script to be:
Add-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST/WEBSITENAME' -filter "system.webServer/aspNetCore/environmentVariables" -name "." -value @{name='EnvironmentVariableName';value='EnvironmentVariableValue'}
Upvotes: 12