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

Fixing Import-Module for PS2 due to AppVeyor changes #41

Conversation

brow1920
Copy link

@brow1920 brow1920 commented Dec 10, 2016

This resolves Issue #42

Although your code didn't change, it appears that the AppVeyor server may have changed.

The command "Import-Module Pester" no longer works for PowerShell 2 using AppVeyor service.

I just ran through your blog post about getting set up with PowerShell / Git / Pester / AppVeyor for CI/CD and was running into errors. Rather than give up on your post, I decided I would dig in and see if there is anything I could do to help. The quickest solution I came up with simply checks if you're running PS2 and if so, find the direct path to the pester module and import using the full path. This option looks for the latest version of the Pester module on the AppVeyor server before importing it, so it should be somewhat future-proof - depending on how the admin for AppVeyor has his server set up.

This is my first PR using public GitHub - but I figured this would help. If you don't accept the PR, could you at least make a note on your blog post or somewhere that your current code/method no longer works and maybe an option to fix it?

Thanks!

@brow1920
Copy link
Author

Also I didn't have any option to squash commits during the merge and Pull Request, so you'll see all the commits I had... is this something that can be done on your end as the repo owner?

@RamblingCookieMonster
Copy link
Owner

Womp! I'm so sorry! Completely forgot about this PR, your workaround is much nicer! Closing this out for now - thanks for taking the time on this, and sorry again!

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.

None yet

2 participants