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

README.md additition #119

Open
pvs043 opened this issue Feb 12, 2022 · 2 comments
Open

README.md additition #119

pvs043 opened this issue Feb 12, 2022 · 2 comments
Labels
documentation The issue is related to documentation only. help wanted The issue is up for grabs for anyone in the community.

Comments

@pvs043
Copy link

pvs043 commented Feb 12, 2022

When I run Invoke-DscResourceTest at clean environment, this error occured:

PS C:\> Invoke-DscResourceTest
Unable to find type [Pester.OutputTypes].
At C:\Program Files\WindowsPowerShell\Modules\DscResource.Test\0.16.0\DscResource.Test.psm1:1628 char:9
+         [Pester.OutputTypes]
+         ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (Pester.OutputTypes:TypeName) [], RuntimeException
    + FullyQualifiedErrorId : TypeNotFound

Problem resolved by running this command before use Invoke-DscResourceTest:

PS C:> New-PesterConfiguration

Run          : Run configuration.
Filter       : Filter configuration
CodeCoverage : CodeCoverage configuration.
TestResult   : TestResult configuration.
Should       : Should configuration.
Debug        : Debug configuration for Pester. ⚠ Use at your own risk!
Output       : Output configuration
TestDrive    : TestDrive configuration.
TestRegistry : TestRegistry configuration.

PS C:\> Invoke-DscResourceTest
cmdlet Invoke-DscResourceTest at command pipeline position 1
Supply values for the following parameters:
ProjectPath:

Please, update documentation.

@johlju
Copy link
Member

johlju commented Mar 4, 2022

I think the command should run Import-Module -Name 'Pester' unless the module is already loaded.

@johlju johlju added bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community. labels Mar 4, 2022
@johlju
Copy link
Member

johlju commented Mar 4, 2022

Hmm... Looking at the code the type is in the parameters, so my suggestion above won't work. So we need to update the documentation as suggested telling the user to import the module Pester prior to invoking the command.

Though, I see there is code to handle Pester 4, but will this work with Pester 4 when that type exist in the parameters... maybe the type exist i Pester 4 as well... 🤔

@johlju johlju added documentation The issue is related to documentation only. and removed bug The issue is a bug. labels Mar 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation The issue is related to documentation only. help wanted The issue is up for grabs for anyone in the community.
Projects
None yet
Development

No branches or pull requests

2 participants