Since version 6.2.0-preview.2 all the files listed in FileList are loaded when the module is loaded.
This is change in behavior caused by PR #8073 which was done to support a customer issue about loading assemblies from module folder first, before looking at GAC.
Hence, the behavior in 6.2.x and 7.0.x is different from Windows PowerShell.
I believe the current behavior is wrong and should be fixed. But, since it as release in 6.2.x and 7.0.x it will be a breaking change.
If we decide to not fix it, it might make moving from Windows PowerShell to PowerShell 7 more difficult.
I would like opinion from committee about fixing the issue in 7.1 and whether it should be back ported to 7.0.x and 6.2.x
Steps to reproduce
Load a module with managed assemblies in FileList in the psd1
$filesBefore = [System.AppDomain]::CurrentDomain.GetAssemblies()
Import-Module <>
$filesAfter = [System.AppDomain]::CurrentDomain.GetAssemblies()
Compare-Object -ReferenceObject $filesBefore -DifferenceObject $filesAfter
Expected behavior
Files in FileList should not be loaded
Actual behavior
Files in FileList are loaded.
Environment data
Name Value
---- -----
PSVersion 7.0.1
PSEdition Core
GitCommitId 7.0.1
OS Microsoft Windows 10.0.19635
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Since version
6.2.0-preview.2all the files listed inFileListare loaded when the module is loaded.This is change in behavior caused by PR #8073 which was done to support a customer issue about loading assemblies from module folder first, before looking at GAC.
Hence, the behavior in
6.2.xand7.0.xis different from Windows PowerShell.I believe the current behavior is wrong and should be fixed. But, since it as release in
6.2.xand7.0.xit will be a breaking change.If we decide to not fix it, it might make moving from Windows PowerShell to PowerShell 7 more difficult.
I would like opinion from committee about fixing the issue in
7.1and whether it should be back ported to7.0.xand6.2.xSteps to reproduce
Load a module with managed assemblies in FileList in the psd1
Expected behavior
Actual behavior
Environment data