PowerShell / platyPS

Write PowerShell External Help in Markdown
MIT License
765 stars 149 forks source link

PlatyPs fails to load alongside powershell-yaml #592

Closed Kaloszer closed 1 year ago

Kaloszer commented 1 year ago

Prerequisites

Steps to reproduce

Import-Module powershell-yaml Import-Module platyps

Import-Module: Assembly with same name is already loaded

Other way around fails aswell.

Expected behavior

Module loads successfully

Actual behavior

Module fails to load

Error details

get-Error

Exception             : 
    Type       : System.IO.FileLoadException
    Message    : Assembly with same name is already loaded
    TargetSite : 
        Name          : Bind_LoadAssemblies
        DeclaringType : initialsessionstate
        MemberType    : Method
        Module        : System.Management.Automation.dll
    Source     : System.Management.Automation
    HResult    : -2146232799
    StackTrace : 
   at System.Management.Automation.Runspaces.InitialSessionState.Bind_LoadAssemblies(ExecutionContext context)
   at System.Management.Automation.Runspaces.InitialSessionState.Bind(ExecutionContext context, Boolean updateOnly, PSModuleInfo module, Boolean noClobber, Boolean local, Boolean setLocation)
   at Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadModuleManifest(String moduleManifestPath, ExternalScriptInfo manifestScriptInfo, Hashtable data, Hashtable localizedData, ManifestProcessingFlags manifestProcessingFlags, Version minimumVersion, Version maximumVersion, Version requiredVersion, Nullable`1 requiredModuleGuid, ImportModuleOptions& options, Boolean& containedErrors)
CategoryInfo          : InvalidOperation: (:) [Import-Module], FileLoadException
FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand
InvocationInfo        : 
    MyCommand        : Import-Module
    ScriptLineNumber : 1
    OffsetInLine     : 1
    HistoryId        : 13
    Line             : import-module platyps
    PositionMessage  : At line:1 char:1
                       + import-module platyps
                       + ~~~~~~~~~~~~~~~~~~~~~
    InvocationName   : import-module
    CommandOrigin    : Internal
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1

### Environment data

```powershell
Name                           Value
----                           -----
PSVersion                      7.3.2
PSEdition                      Core
GitCommitId                    7.3.2
OS                             Microsoft Windows 10.0.22621
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Script     0.14.2                platyPS                             Desk      {New-MarkdownHelp, Get-MarkdownMetadata, New-ExternalHelp, New-YamlHelp…}
Script     0.4.4                 powershell-yaml                     Desk      {ConvertTo-Yaml, ConvertFrom-Yaml, cfy, cty}

Visuals

image

Kaloszer commented 1 year ago

Is this possibly fixed with #481 in future release?

sdwheeler commented 1 year ago

@Kaloszer This is a known issue with the current version. This has been fixed in the v2 preview build.