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

Add public commands Get-PSModulePath and Get-EnvironmentVariable #104

Merged
merged 5 commits into from
Apr 9, 2023

Conversation

johlju
Copy link
Member

@johlju johlju commented Mar 26, 2023

Pull Request (PR) description

  • New public commands.
    • Get-EnvironmentVariable - Get a specific environment variable from a
      specific environment variable target.
    • Get-PSModulePath - Get the the PSModulePath from one or more environment
      variable targets - Issue #103

This Pull Request (PR) fixes the following issues

Task list

  • Added an entry to the change log under the Unreleased section of the
    file CHANGELOG.md. Entry should say what was changed and how that
    affects users (if applicable), and reference the issue being resolved
    (if applicable).
  • Documentation added/updated in README.md.
  • Comment-based help added/updated for all new/changed functions.
  • Localization strings added/updated in all localization files as appropriate.
  • Examples appropriately added/updated.
  • Unit tests added/updated. See DSC Community Testing Guidelines.
  • Integration tests added/updated (where possible). See
    DSC Community Testing Guidelines.
  • New/changed code adheres to DSC Community Style Guidelines.

This change is Reviewable

@johlju johlju added the needs review The pull request needs a code review. label Mar 26, 2023
@johlju johlju requested a review from PlagueHO March 28, 2023 05:52
@codecov
Copy link

codecov bot commented Mar 28, 2023

Codecov Report

Merging #104 (eb48057) into main (e817645) will decrease coverage by 1%.
The diff coverage is 88%.

Impacted file tree graph

@@         Coverage Diff         @@
##           main   #104   +/-   ##
===================================
- Coverage    92%    92%   -1%     
===================================
  Files        35     37    +2     
  Lines       628    645   +17     
===================================
+ Hits        579    594   +15     
- Misses       49     51    +2     
Impacted Files Coverage Δ
source/Public/Get-EnvironmentVariable.ps1 60% <60%> (ø)
source/Public/Get-PSModulePath.ps1 100% <100%> (ø)

@johlju johlju changed the title New public commands Get-PSModulePath and Get-EnvironmentVariable Add public commands Get-PSModulePath and Get-EnvironmentVariable Apr 6, 2023
@johlju johlju force-pushed the f/new-command-Get-PSModulePath branch from b357516 to 15d0ce2 Compare April 6, 2023 08:53
Copy link
Member

@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.

Reviewed 6 of 6 files at r1, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @johlju)


README.md line 723 at r1 (raw file):

Returns the environment variable PSModulePath from the specified target.
If more than one target are provided only the unique paths will be

Could this be changed to:
If more than one target is provided the return will contain all the concatenation of all unique paths from the targets.


source/Public/Get-PSModulePath.ps1 line 8 at r1 (raw file):

    .DESCRIPTION
        Returns the environment variable PSModulePath from the specified target.
        If more than one target are provided only the unique paths will be

See previous comment on clarification of behavior.


source/Public/Get-PSModulePath.ps1 line 41 at r1 (raw file):

    )

    $modulePathSession = $null

nit: I don't think (I couldn't find) a style guideline on this, but you could use (although not sure it's the most clear syntax). Will leave it up to you:

Suggestion:

    $modulePathSession = $modulePathUser = $modulePathMachine = $null

tests/Unit/Public/Get-PSModulePath.Tests.ps1 line 86 at r1 (raw file):

        }
    }

Nit: remove blank line.

@johlju johlju requested a review from PlagueHO April 7, 2023 10:21
Copy link
Member Author

@johlju johlju left a comment

Choose a reason for hiding this comment

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

Reviewable status: 3 of 6 files reviewed, 2 unresolved discussions (waiting on @PlagueHO)


README.md line 723 at r1 (raw file):

Previously, PlagueHO (Daniel Scott-Raynsford) wrote…

Could this be changed to:
If more than one target is provided the return will contain all the concatenation of all unique paths from the targets.

Done.


source/Public/Get-PSModulePath.ps1 line 8 at r1 (raw file):

Previously, PlagueHO (Daniel Scott-Raynsford) wrote…

See previous comment on clarification of behavior.

Done.


source/Public/Get-PSModulePath.ps1 line 41 at r1 (raw file):

Previously, PlagueHO (Daniel Scott-Raynsford) wrote…

nit: I don't think (I couldn't find) a style guideline on this, but you could use (although not sure it's the most clear syntax). Will leave it up to you:

Done. We can do it this way too. Changed. 🙂


tests/Unit/Public/Get-PSModulePath.Tests.ps1 line 86 at r1 (raw file):

Previously, PlagueHO (Daniel Scott-Raynsford) wrote…

Nit: remove blank line.

Done.

@johlju
Copy link
Member Author

johlju commented Apr 7, 2023

@PlagueHO thanks for the review! Hopefully it good to be sign-off on now. 🙂

Copy link
Member

@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.

:lgtm:

Reviewed 3 of 3 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @johlju)

@PlagueHO PlagueHO merged commit 9d4c630 into dsccommunity:main Apr 9, 2023
10 checks passed
@johlju johlju removed the needs review The pull request needs a code review. label Apr 10, 2023
@johlju johlju deleted the f/new-command-Get-PSModulePath branch April 10, 2023 06:54
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.

Get-PSModulePath: New command proposal
2 participants