Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Matteo-T opened this issue May 9, 2017 · 7 comments
Closed
Assignees
Labels
Issue-Bug Issue has been identified as a bug in the product Resolution-Fixed The issue is fixed. WG-Cmdlets-Core cmdlets in the Microsoft.PowerShell.Core module
Milestone

Comments

@Matteo-T
Copy link

Matteo-T commented May 9, 2017

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
@iSazonov iSazonov added WG-Cmdlets-Core cmdlets in the Microsoft.PowerShell.Core module Issue-Discussion the issue may not have a clear classification yet. The issue may generate an RFC or may be reclassif labels May 9, 2017
@iSazonov
Copy link
Collaborator

iSazonov commented May 9, 2017

@Matteo-T Thanks for your report! Could you check on latest PowerShell Core?

@Matteo-T
Copy link
Author

Matteo-T commented May 9, 2017

My module does not work on PowerShell Core, so I'm not sure how that would help... I'm not sure I'll have time to create a dummy repro (i.e. a dummy module) that works on PowerShell Core any time soon, but if I have to...

@megamorf
Copy link
Contributor

megamorf commented May 9, 2017

This repo is for PowerShell Core only. Please report regular Windows PowerShell issues on the uservoice website:

https://windowsserver.uservoice.com/forums/301869-powershell

@iSazonov
Copy link
Collaborator

iSazonov commented May 9, 2017

@Matteo-T Please test after PowerShell Core Beta1 release (in the coming days).
And yes, we can report on UserVoice.

@Matteo-T
Copy link
Author

Matteo-T commented May 9, 2017

Sorry, I did not know this was for "Core" only. I was told to come here, but I guess I was told incorrectly. I'll try the UserVoice thing...

@joeyaiello
Copy link
Contributor

@megamorf @Matteo-T for bugs that are almost certainly applicable to both editions of PowerShell, it's perfectly fine to file them here. I suspect that this one repros on Core 6 just fine, and given the importance of Import-Module we should probably get it fixed (assuming it does repro).

I'll build a basic repro on my box right now.

@joeyaiello
Copy link
Contributor

Yup, totally repros on 6.0.0-alpha.18 and 6.0.0-beta.1:

C:\> mkdir C:\temp\VersionParam
C:\> cd temp\VersionParam
C:\temp\VersionParam> 1 | Out-File Output1.ps1
C:\temp\VersionParam> New-ModuleManifest VersionParam.psd1 -ScriptsToProcess .\Output1.ps1
C:\temp\VersionParam> Import-Module .\VersionParam.psd1
1
C:\temp\VersionParam> Remove-Module VersionParam
C:\temp\VersionParam> Import-Module .\VersionParam.psd1 -Version 1.0
C:\temp\VersionParam> Get-Module VersionParam

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Manifest   1.0        VersionParam

@joeyaiello joeyaiello added Issue-Bug Issue has been identified as a bug in the product and removed Issue-Discussion the issue may not have a clear classification yet. The issue may generate an RFC or may be reclassif labels May 10, 2017
@joeyaiello joeyaiello added this to the 6.0.0-beta milestone May 10, 2017
@anmenaga anmenaga self-assigned this May 11, 2017
@SteveL-MSFT SteveL-MSFT modified the milestones: 6.0.0-beta, 6.0.0, 6.0.0-HighPriority May 15, 2017
@SteveL-MSFT SteveL-MSFT added the Resolution-Fixed The issue is fixed. label Jun 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug Issue has been identified as a bug in the product Resolution-Fixed The issue is fixed. WG-Cmdlets-Core cmdlets in the Microsoft.PowerShell.Core module
Projects
None yet
Development

No branches or pull requests

6 participants