Skip to content

ScriptsToProcess not honored when Import-Module is passed -Version param #3738

@Matteo-T

Description

@Matteo-T

Steps to reproduce

  • Install SqlServer module from PSGallery (I doubt the issue is specific to my module, though)
  • Open PowerShell (full .Net, I'm on Win10 using the PowerShell that comes with the OS)
    PowerShell -executionpolicy bypass
  • Import-Module SqlServer -Verbose
    (observe that SqlServer.ps1, listed in the SqlServer.psd1 manifest file, is loaded during import)
  • Close PowerShell
  • Restart PowerShell (same as above)
  • Import-Module SqlServer -Verbose -Version 21.0.17099

Expected behavior

The SqlServer.ps1 script is loaded

Actual behavior

The SqlServer.ps1 script is NOT loaded

Environment data

> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      5.1.16192.0
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.16192.0
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Metadata

Metadata

Assignees

Labels

Issue-BugIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.WG-Cmdlets-Corecmdlets in the Microsoft.PowerShell.Core module

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions