Closed erossini closed 8 months ago
The variable $PSScriptRoot
. So . $PSScriptRoot/../JsonFiltering.ps1
.
Thank you for answer. If it can be useful, here the code
$scriptRoot = "$PSScriptRoot/../../"
$filename = (Split-Path $PSCommandPath -Leaf).Replace('.Tests.ps1', '.ps1')
$scriptToTest = [System.IO.Path]::Combine($scriptRoot, $filename)
Checklist
Summary of the feature request
To organize better the scripts and the relative tests, I created in my pipeline a simple structure: the scripts folder has all the scripts; then the tests folder contains the folder for each script and the necessary files.
I have an issue in find the script from the test in the setup. For example, the code is
Also, I tried to write the setup like this
but I still get an error
Is there a way to use a script in the parent directory?
How should it work?
No response