I wrote an Azure PowerShell task in the Azure DevOps YAML pipeline as given below
- task: AzurePowerShell@3
displayName: 'Invoke Test'
inputs:
azureSubscription: 'subscriptionname'
ScriptPath: '$(Build.SourcesDirectory)\ProjectName\Scripts\Build\TestRelease.ps1'
ScriptArguments: -testfilepath '$(Build.SourcesDirectory)\ProjectName\Releases\test.json -JsonFilepath '$(Build.SourcesDirectory)\test\qa\test_qa.json' -AzuredevopsService $(AzuredevopsService) -Verbose
azurePowerShellVersion: LatestVersion
Even though the pipeline job is getting executed successfully the above PowerShell task is not executing and getting the log as given below. The same PowerShell script when I am calling from classic editor pipeline it is working
## Initializing Azure Complete
## Beginning Script Execution
& 'C:\devops\vsts-agent-win-x64-2.154.3\_work\10\s\ProjectName\Scripts\Build\TestRelease.ps1' -testfilepath 'C:\devops\vsts-agent-win-x64-2.154.3\_work\10\s\ProjectName\Releases\test.json' -JsonFilepath 'C:\devops\vsts-agent-win-x64-2.154.3\_work\10\s\test\qa\test_qa.json' -AzuredevopsService https://test.azure.com -organisation OrgName -Verbose
## Script Execution Complete