I am trying to call a powershell script from another powershell script which is in a sub-directory. Directory structure is as below:
main_script.ps1
./Test:
. .. test.ps1
So i am calling main_script.ps1 from the test.ps1 as below:
#Call the main script
../main_script.ps1
When i am doing that from the cloud shell with the same structure, i can call the main_script.ps1 script succesfully. But in azure devops i am having the error below:
##[error]The term '../main_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.
Do you have any idea about the correct path? What is the default path of azure devops task? I am using Azure Devops Release to create the pipeline.
test.ps1
exists in the working directory of the powershell script task. That because the default work folder isSystem.DefaultWorkingDirectory
docs.microsoft.com/en-us/azure/devops/pipelines/build/… – Leo Liu-MSFT