Skip to content

import-module incorrectly reporting a loaded module was not found - #5238

Merged
Dongbo Wang (daxian-dbw) merged 2 commits into
PowerShell:masterfrom
SteveL-MSFT:import-module
Oct 26, 2017
Merged

Dongbo Wang (daxian-dbw) merged 2 commits into
PowerShell:masterfrom
SteveL-MSFT:import-module

Conversation

@SteveL-MSFT

Copy link
Copy Markdown
Member

missing break after module was loaded successfully so loop continues
but module isn't "found" and thus reports error even though loaded

Fix #5232

missing break after module was loaded successfully so loop continues
but module isn't "found" and thus reports error even though loaded
fix older test
@@ -27,6 +39,11 @@
{ $script:module = Import-Module $moduleName -PassThru } | Should Not Throw

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add -ErrorAction Stop as a failed load is not a terminating error

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will add

@daxian-dbw

Copy link
Copy Markdown
Member

Shall we add the '[Feature]' tag to run all tests?

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Dongbo Wang (@daxian-dbw) it wouldn't hurt to run [feature] tests, will update

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Dongbo Wang (@daxian-dbw) looks like for mac Travis-CI installed beta.8, but the scripts tried to start pwsh. Did we publish beta.9 to homebrew already?

@daxian-dbw

Dongbo Wang (daxian-dbw) commented Oct 25, 2017 •

Copy link
Copy Markdown
Member

Steve Lee (@SteveL-MSFT) The PR to update powershell.beta.9 in homebrew is here: Homebrew/homebrew-cask#40043

Aditya Patwardhan (@adityapatwardhan) submitted the PR early this morning, but it hasn't been merged yet.

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Dongbo Wang (@daxian-dbw) thanks, I guess we'll just wait for that to merged then I'll restart the macOS job

@adityapatwardhan

Copy link
Copy Markdown
Member

Steve Lee (@SteveL-MSFT) restarted the Travis-CI macOS job. The homebrew PR is merged.

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

James Truher (@JamesWTruher) can you re-review?

@daxian-dbw
Dongbo Wang (daxian-dbw) merged commit 967ed8b into PowerShell:master Oct 26, 2017
@SteveL-MSFT
Steve Lee (SteveL-MSFT) deleted the import-module branch October 26, 2017 22:35
Matt Gucci (matt9ucci) added a commit to matt9ucci/PSProfiles that referenced this pull request Nov 6, 2017
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
…rShell#5238)

Missed a 'break' statement after the module was loaded successfully, so the loop continues when it shouldn't.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants