Cross platform system libraries reference for PowerShell and Server Manager module
Have you tried assembly redirection in your .config file for those references?
<runtime> <assemblyBinding appliesTo="v2.0.50727" xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/> <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/> <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/> </dependentAssembly> </assemblyBinding> </runtime>
You could just check for the OS Version and depending on that import the corresponding library.
# show complete OS information$os = Get-CimInstance Win32_OperatingSystem | Format-List *
Just check the name or directly use the version.
$os.version #6.3.9600$os.name #Microsoft Windows Server 2012 R2
Hope this serves as another option.