I have below code in yaml file:
trigger:
branches:
include:
- maventest
pool:
vmImage: ubuntu-latest
steps:
- task: PowerShell@2
inputs:
filePath: './1.ps1'
Below is 1.ps1 file
$user1=@($(user))
Write-Host $(user)
write-host $user1[0]
As I can pass the value of variable inside while run pipeline but user is not getting from variable.

I had also used the $(env:user) but it didn't get value from variable.

