I have the following Powershell code:
Add-Type -Assembly System.Configuration
[ExeConfigurationFileMap] $configMap = New-Object ExeConfigurationFileMap
All I want to do is create a new instance of ExeConfigurationFileMap, but each and every way I try, PS keeps telling me that it cannot find the type ExeConfigurationFileMap and that I should check the type’s assembly is loaded into memory.
I’ve tried different ways of loading the System.Configuration assembly into memory, but the code still fails to work.
Could someone please assist me with this please?
try: