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

Correct loading logic for Exchange Powershell snapin #16

Merged
merged 1 commit into from
Oct 11, 2021
Merged

Correct loading logic for Exchange Powershell snapin #16

merged 1 commit into from
Oct 11, 2021

Conversation

markpizz
Copy link
Contributor

It seemed that the intent of the original logic was to allow the Exchange
snapin to be loaded externally or previously and if it hasn't yet been
loaded, then do it automatically.

The original code didn't quite achieve this, there were two errors:

  1. The test of the existence somewhere on the machine for the Exchange snapin should be a -Registered check, but it was coded as without -Registered and thus only succeeded if the snapin was previously loaded.
  2. The second check should have tested whether it had been loaded, but it merely tested to see if it existed (-Registered) and thus always attempted to load the snapin which resulted in messages about it already being loaded.

@rmbolger rmbolger self-assigned this Oct 11, 2021
@rmbolger rmbolger added the enhancement New feature or request label Oct 11, 2021
@rmbolger
Copy link
Owner

Thanks again, @markpizz. This function was submitted by a user and I haven't worked with snap-ins all that much which is why I probably missed it during review. Your explanation and fix seems logical.

@rmbolger rmbolger merged commit 3c2b8c3 into rmbolger:main Oct 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants