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

Adding condition to import module #414

Closed
wants to merge 2 commits into from
Closed

Conversation

mariussm
Copy link

@mariussm mariussm commented May 7, 2021

Pull Request

Bug Fixes

Improvements / Enhancements

Added support for pre-loading Az.Accounts and Az.Resources modules. This enables things like using Save-Module and storing the modules in folders, which can be useful when running the module as a part of an Azure Function.


This change is Reviewable

@mariussm mariussm marked this pull request as ready for review May 7, 2021 14:13
Copy link
Owner

@PlagueHO PlagueHO left a comment

Choose a reason for hiding this comment

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

Awesome! Thanks @mariussm - can you add an entry to the CHANGELOG.md file under ## [Unreleased]?

E.g.

## [Unreleased]

### Changed

- Changed module import process to load the Az.Accounts and Az.Resources modules
  only if they haven't already been loaded to support saving the module and storing in
  folders.

Reviewed 1 of 1 files at r1.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @mariussm)


source/prefix.ps1, line 13 at r1 (raw file):

# Import dependent Az modules
if(!(Get-Module -Name Az.Accounts)) {

Minor style nitpick: Can you use the format:

if (-not (Get-Module -Name Az.Accounts))
{

source/prefix.ps1, line 17 at r1 (raw file):

}

if(!(Get-Module -Name Az.Resources)) {

Minor style nitpick: Can you use the format:

if (-not (Get-Module -Name Az.Resources))
{

@PlagueHO
Copy link
Owner

Closing as replaced by #484

@PlagueHO PlagueHO closed this May 19, 2024
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