You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the issue @GreatTeacherBasshead. I can repo this, but the cause isn't immediately obvious. I suspect we have some funny things with scoping going on.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I have a PSake script:
#Requires -Modules @{ModuleName='dependent'; RequiredVersion='1.0.0'}
Task Show {Show-Version}
And 2 modules (2 versions). One depends on another:
dependent
1.0.0:
psm1: function Show-Version {Show-VersionBase}
psd1: RequiredModules = @(@{ModuleName = 'main'; RequiredVersion = '1.0.0'})
2.0.0:
psm1: function Show-Version {Show-VersionBase}
psd1: RequiredModules = @(@{ModuleName = 'main'; RequiredVersion = '2.0.0'})
main
1.0.0 : function Show-VersionBase {"1.0.0"}
2.0.0 : function Show-VersionBase {"2.0.0"}
Expected Behavior
It outputs "1.0.0"
Current Behavior
It outputs "2.0.0"
Context
I have different versions of modules deployed on a build server. Psake takes the latest version, instead of 'required' one, causing failures.
This perfectly works when using plain powershell:
#Requires -Modules @{ModuleName='dependent'; RequiredVersion='1.0.0'}
Show-Version
Your Environment
The text was updated successfully, but these errors were encountered: