[ad_1]
I have a pipeline task which is as follow:
- task: [email protected]
displayName: 'Script1'
inputs:
filePath: '$(System.DefaultWorkingDirectory)/Terraform/helloworld1.ps1'
And it run a helloworld1.ps1 , but the helloworld1.ps1 script call another script.
here’s the code of helloworld1:
& "$PSScriptRoot/helloworld2.ps1"
Write-Host 'Hello from 1st File.'
printHello
And the helloworld2.ps1 scripts contains this one line only:
function printHello()
{
Write-Host 'Hello from 2nd File.'
}
BUT, when when pipelines triggers, its run the Helloworld1.ps1 and print its 2nd line and then failed on 3rd line throwing the error:
| The term 'PrintHello' is not recognized as a name of a
| cmdlet, function, script file, or executable program. Check
| the spelling of the name, or if a path was included, verify
| that the path is correct and try again.
[ad_2]