Get-PSDrive : Cannot find drive. A drive with the name 'TestDrive' does not exist.
At /usr/local/microsoft/powershell/6.0.0-beta.9/Modules/Pester/4.0.8/Functions/TestDrive.ps1:36 char:14
+ $Path = (& $SafeCommands['Get-PSDrive'] -Name TestDrive).Root
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (TestDrive:String) [Get-PSDrive], DriveNotFoundException
+ FullyQualifiedErrorId : GetLocationNoMatchingDrive,Microsoft.PowerShell.Commands.GetPSDriveCommand
[-] Error occurred in Describe block 1.3s
ParameterBindingValidationException: Cannot bind argument to parameter 'Path' because it is null.
at Clear-TestDrive, /usr/local/microsoft/powershell/6.0.0-beta.9/Modules/Pester/4.0.8/Functions/TestDrive.ps1: line 37
at DescribeImpl, /usr/local/microsoft/powershell/6.0.0-beta.9/Modules/Pester/4.0.8/Functions/Describe.ps1: line 175
at Describe, /usr/local/microsoft/powershell/6.0.0-beta.9/Modules/Pester/4.0.8/Functions/Describe.ps1: line 84
at <ScriptBlock>, /Users/felix/git/ps-nvmw/nvm.Tests.ps1: line 3
at <ScriptBlock>, /usr/local/microsoft/powershell/6.0.0-beta.9/Modules/Pester/4.0.8/Pester.psm1: line 802
at Invoke-Pester<End>, /usr/local/microsoft/powershell/6.0.0-beta.9/Modules/Pester/4.0.8/Pester.psm1: line 817
at <ScriptBlock>, <No file>: line 1
Hi All, I am looking for feedback on a VS extension for Pester.
It is located here:
https://marketplace.visualstudio.com/items?itemName=Jonkers.PowershellPesterTestrunner
The current version has a Test Toolwindow, a Coverage Toolwindow and shows the line hits in misses in the editor.
test-PesterPipelineIssue /Users/me/testingDir/testPester.txt | Should beNullOrEmpty
[System.Environment]::GetEnvironmentVariable()
and mock that. Another way might be to make a stub class and load with Add-Type
, but not sure it works in this case since the type is already loaded.
Hey guys I am trying to use Pester (4.8.1) for our azure devops pipeline CI build. I have a "publish test" task and
this is what I am doing right nowInvoke-Pester -Script $testFilePath -OutputFile $outputFilePath -OutputFormat 'NUnitXML' -CodeCoverage $psFiles -CodeCoverageOutputFile $codeCoverageOutputFIlePath -EnableExit
My questions is: Is there a way I can put the result in a variable using passthru and and still save all the outputs in the specified files? I want the task to fail if any tests fail but I also have following tasks that shows test result and I want to see which tests failed. With -EnableExit fail it fails the testing task but it skips publishing test result task too
Invoke-Pester -Script @{Path = 'C:\Turing\Test\Frida-launcher.ps1'; Parameters = @{frida_process_id = '807028544'; frida_user = 'heber.solis@softtek.com'; frida_psw = 'password'}} -OutputFile "frida-results.xml" -OutputFormat "NUnitXML"
but I don't know how to do it for every test case in the suite :(. Thanks for any help :)