Hi
I try to comply with the rule azurepipelines:S8263. Here is my task:
variables:
- name: system.debug
value: $(SystemDebug)
- template: /.azuredevops/azure-pipelines/variables/deployment.yaml
- task: PowerShellOnTargetMachines@3
displayName: 'Stop App scheduled task and process'
inputs:
Machines: 'MyMachineName'
InlineScript: |
$taskName = '${{ variables.scheduledTaskName }}'
$processName = '${{ variables.deploymentProcessName }}'
Stop-ScheduledTask -TaskName $taskName -ErrorAction SilentlyContinue | Out-Null
$processes = Get-Process -Name $processName -ErrorAction SilentlyContinue
Write-Host "Stopping process '$processName'..."
$processes | Stop-Process -Force
Write-Host "Process stop completed."
CommunicationProtocol: 'Http'
In a template file, I have my variables:
variables:
- name: deploymentProcessName
value: 'MyProcess'
- name: scheduledTaskName
value: 'MySchedTask'
According to the rule, I should use environment variables with env, but it doesn’t work. The environment variables do not seem to be transmitted on another machine with the PowerShellOnTargetMachines task.
What can I do to fix this ?
Version : SonarQube Server Developer Edition (2026.3.1)
Deployment : Docker