Execute command with relative path inside Inline script

37 views Asked by At

I've the following code to execute parallels command in powershell

workflow Test-Workflow {
    
    $Sites = "Param1", "Param2", "Param3"
    
    ForEach -Parallel ($site in $Sites) {
        Parallel {
            InlineScript { C:\MyScriptsFolder\Script.ps1 -siteName $using:Sites}
        }
    }
}

Test-Workflow

I would like to execute my script with a relative path, instead of full path. But If I try to execute as

InlineScript { ..\Script.ps1 -siteName $using:Sites}

I got the error

e term ..\Script.ps1 is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

How can I use relative paths with InlineScript?

Thanks

0

There are 0 answers