The version of Markdig that comes with powershell is really old, so I wanted to use a newer one
I start a new PS Session
[System.AppDomain]::CurrentDomain.GetAssemblies() | Where-Object Location | Sort-Object -Property FullName | Select-Object -Property FullName, Location, GlobalAssemblyCache, IsFullyTrusted | where {$_.FullName -match 'Markdig'}
and I get no results - great, no markdig loaded to the session - so should be no problems with side-by-side loading.
I get the latest version of Markdig.Signed from Nuget and Add-Type
Add-Type -path .\application\Depend-NuGet\Markdig.Signed\lib\netstandard2.0\Markdig.Signed.dll -Verbose
but it totally ignores me and adds the old one from the powershell\7 folder
[System.AppDomain]::CurrentDomain.GetAssemblies() | Where-Object Location | Sort-Object -Property FullName | Select-Object -Property FullName, Location, GlobalAssemblyCache, IsFullyTrusted | where {$_.FullName -match 'Markdig'}
FullName Location GlobalAssemblyCache IsFullyTrusted
-------- -------- ------------------- --------------
Markdig.Signed, Version=0.21.1.0, Culture=neutral, PublicKeyToken=870da25a133885f8 C:\Program Files\PowerShell\7\Markdig.Signed.dll False True
So annoying. It would be nice if Add-Type could give a warning or something if it was going to totally ignore what it was asked to do.
Is there any way to solve this?