Using CurrentDomain.SetData(“APP_CONFIG_FILE”) doesn't work in PowerShell ISE
问题 I'm attempting to use a .NET 4.0 assembly in PowerShell ISE, and trying to change the config file which is used via: [System.AppDomain]::CurrentDomain.SetData("APP_CONFIG_FILE", $PathToConfig); [Configuration.ConfigurationManager]::ConnectionStrings.Count always returns "1", and "[Configuration.ConfigurationManager]::ConnectionStrings[0].Name" always returns "LocalSqlServer", and that ConnectionString name is not in my ".config" file. Note that executing the PowerShell script from a