PowerShell / PowerShell/PSScriptAnalyzer

Being able to run tests by setting $PsModulePath instead of XCopy to one of those folders

Open
#965 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area - Build
Dominant language
C#
Stars
2.2k
Forks
414
Avg merge
13h 1m
Merged PRs (30d)
2

Description

As discussed internally. Instead of doing a Copy-Item of the PSScriptAnalyer folder in the out folder to the first $env:PSModulePath folder (where it can override an existing installation due to the version number being the same), we should just be able to just set add the out folder to the beginning of the $env:PSModulePath variables during test execution. However, this does not even work for Windows PowerShell at the moment due to the LibraryUsageTests (I get one failure here).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the test setup that copies the PSScriptAnalyzer folder from the out folder and the failure in Tests/Engine/LibraryUsage.tests.ps1 at line 214. Reproduce the Windows PowerShell failure, then verify that test execution uses the out folder at the beginning of $env:PSModulePath and that the test suite passes without copying the module.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
testing-qa, tooling
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.