Assemblies listed in FileList Module Manifest Property are being Processed.
See original GitHub issueSteps to reproduce
I have a WinSCP PowerShell Module Wrapper, and I was implementing some functionality to load one WinSCPnet.dll if it is PowerShell core, and a different one if it is PowerShell desktop. And I kept getting errors stating that the assembly of the same name was already loaded.
Turns out, I had both of the assemblies listed in the Module Manifest FileList property, after removing them from there, the logic to add the correct assembly works fine. Per this link, that property should be for inventory only, and should not process the files in the value: https://docs.microsoft.com/en-us/powershell/scripting/developer/module/how-to-write-a-powershell-module-manifest?view=powershell-7#module-manifest-elements
# Assembly loading logic from WinSCP.psm1
$moduleRoot = Split-Path -Path $MyInvocation.MyCommand.Path
switch ($PSVersionTable.PSEdition) {
"Core" {
#Add-Type -Path "${moduleRoot}\lib\netstandard2.0\WinSCPnet.dll"
add-type -path ./Documents/github/WinSCP/WinSCP/lib/netstandard2.0/WinSCPnet.dll
break;
}
"Desktop" {
Add-Type -Path "${moduleRoot}\lib\net40\WinSCPnet.dll"
break;
}
default {
Write-Error -Message "Failed to find a compatiable WinSCP Assembly."
exit
}
}
When the FileList property in the manifest has those files listed in the value, I get the “Assembly with the same name is already loaded” error

if I remove the .dll values from that list, the logic works fine and the proper dll is loaded.
Expected behavior
No processing of the files in the FileList module manifest property value.
Actual behavior
Im not sure in what way, but he files are being executed or processed.
Environment data
PS /Users/thomas> $psversiontable
Name Value
---- -----
PSVersion 7.0.3
PSEdition Core
GitCommitId 7.0.3
OS Darwin 20.0.0 Darwin Kernel Version 20.0.0: Thu…
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Issue Analytics
- State:
- Created 3 years ago
- Comments:6

Top Related StackOverflow Question
Oops, my bad. Leaving that one on so we can consider backporting if we feel it’s needed.
sorry took so long, but I finally got time to install 7.1.6, and it does seem this is fixed in that release. thanks.