I can\'t get the App.Config file to load into the App Domain.
I\'m using
[System.AppDomain]::CurrentDomain.SetData(\"APP_CONFIG_FILE\", $config_path)
>
Try moving your SetData statement before the GetField statement.
With PowerShell 5.0 on Windows 10, the guidance provided by the link you reference seems to work: I'm able to retrieve both AppSettings and ConnectionStrings.
Add-Type -AssemblyName System.Configuration
# Set this to the full path of your App.config
$configPath = "C:\Full\Path\To\App.config"
[System.AppDomain]::CurrentDomain.SetData("APP_CONFIG_FILE", $configPath)
[Configuration.ConfigurationManager].GetField("s_initState", "NonPublic, Static").SetValue($null, 0)
[Configuration.ConfigurationManager].GetField("s_configSystem", "NonPublic, Static").SetValue($null, $null)
([Configuration.ConfigurationManager].Assembly.GetTypes() | where {$_.FullName -eq "System.Configuration.ClientConfigPaths"})[0].GetField("s_current", "NonPublic, Static").SetValue($null, $null)
[System.Configuration.ConfigurationManager]::AppSettings
[System.Configuration.ConfigurationManager]::ConnectionStrings