Subsonic Access To App.Config Connection Strings From Referenced DLL in Powershell Script Subsonic Access To App.Config Connection Strings From Referenced DLL in Powershell Script powershell powershell

Subsonic Access To App.Config Connection Strings From Referenced DLL in Powershell Script


Did you add the System.Configuration assembly to your PowerShell session? The following works for me:

PS> gc .\app.config<?xml version='1.0' encoding='utf-8'?><configuration>    <connectionStrings>      <clear />      <add name="Name"           providerName="System.Data.ProviderName"           connectionString="Valid Connection String;" />    </connectionStrings></configuration>PS> [appdomain]::CurrentDomain.SetData("APP_CONFIG_FILE", "$home\app.config")PS> Add-Type -AssemblyName System.ConfigurationPS> [Configuration.ConfigurationManager]::ConnectionStrings['Name']Name                    : NameConnectionString        : Valid Connection String;...