Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Tasks/AzureFileCopyV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 1,
"Minor": 275,
"Patch": 0
"Patch": 1
},
"demands": [
"azureps"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureFileCopyV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 1,
"Minor": 275,
"Patch": 0
"Patch": 1
},
"demands": [
"azureps"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureFileCopyV2/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 2,
"Minor": 275,
"Patch": 0
"Patch": 1
},
"demands": [
"azureps"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureFileCopyV2/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 2,
"Minor": 275,
"Patch": 0
"Patch": 1
},
"demands": [
"azureps"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureFileCopyV3/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 3,
"Minor": 275,
"Patch": 0
"Patch": 1
},
"demands": [
"azureps"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureFileCopyV3/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 3,
"Minor": 275,
"Patch": 0
"Patch": 1
},
"demands": [
"azureps"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureFileCopyV4/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 4,
"Minor": 275,
"Patch": 0
"Patch": 2
},
"demands": [
"azureps"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureFileCopyV4/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 4,
"Minor": 275,
"Patch": 0
"Patch": 2
},
"demands": [
"azureps"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureFileCopyV5/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 5,
"Minor": 275,
"Patch": 0
"Patch": 2
},
"demands": [
"azureps"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureFileCopyV5/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 5,
"Minor": 275,
"Patch": 0
"Patch": 2
},
"demands": [
"azureps"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureFileCopyV6/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 6,
"Minor": 275,
"Patch": 2
"Patch": 4
},
"demands": [
"azureps"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureFileCopyV6/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 6,
"Minor": 275,
"Patch": 2
"Patch": 4
},
"demands": [
"azureps"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzurePowerShellV2/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 2,
"Minor": 275,
"Patch": 0
"Patch": 1
},
"demands": [
"azureps"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzurePowerShellV2/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 2,
"Minor": 275,
"Patch": 0
"Patch": 1
},
"demands": [
"azureps"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzurePowerShellV3/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 3,
"Minor": 275,
"Patch": 0
"Patch": 1
},
"releaseNotes": "Added support for Fail on standard error and ErrorActionPreference",
"demands": [
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzurePowerShellV3/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 3,
"Minor": 275,
"Patch": 0
"Patch": 1
},
"releaseNotes": "ms-resource:loc.releaseNotes",
"demands": [
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzurePowerShellV4/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 4,
"Minor": 275,
"Patch": 2
"Patch": 4
},
"releaseNotes": "Added support for Az Module and cross platform agents.",
"groups": [
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzurePowerShellV4/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 4,
"Minor": 275,
"Patch": 2
"Patch": 4
},
"releaseNotes": "ms-resource:loc.releaseNotes",
"groups": [
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzurePowerShellV5/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 5,
"Minor": 275,
"Patch": 4
"Patch": 6
},
"releaseNotes": "Added support for Az Module and cross platform agents.",
"groups": [
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzurePowerShellV5/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 5,
"Minor": 275,
"Patch": 4
"Patch": 6
},
"releaseNotes": "ms-resource:loc.releaseNotes",
"groups": [
Expand Down
9 changes: 8 additions & 1 deletion Tasks/Common/Sanitizer/Expand-EnvVariables.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,14 @@ function Expand-EnvVariables([string]$ArgsLine) {
$telemetry.bracedVariables++
}
else {
$envName = $result.Substring($envStartIndex).Split(' ', '"', "'", ';', '$')[0]
# Terminate the env-name on whitespace too (newline / carriage return / tab),
# not just space. YAML folded scalars ('arguments: >') produce embedded newlines;
# without these terminators the env-name greedily spans across lines, the lookup
# returns $null, the literal '$env:VAR<newline>...' falls through to the sanitizer
# allowlist, and a perfectly valid PowerShell argument string is rejected.
# Companion to PR #22181 which fixed the same bug in the TypeScript twin
# (expandPowerShellEnvVariables, regression #22173).
$envName = $result.Substring($envStartIndex).Split(' ', '"', "'", ';', '$', "`n", "`r", "`t")[0]
$envEndIndex = $envStartIndex + $envName.Length
}

Expand Down
35 changes: 35 additions & 0 deletions Tasks/Common/Sanitizer/Tests/L0Expand-EnvVariables.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,41 @@ $testSuites = @(
Input = '${env:VAR1 ${env:VAR2}'
Variables = @('VAR1=val1', 'VAR2=val2')
Expected = '${env:VAR1 ${env:VAR2}'
},
# Regression coverage for PR #22181 / issue #22173 ported to the PowerShell expander.
# YAML folded scalars ('arguments: >') emit literal LF/CR between joined lines; the
# env-name terminator must include whitespace, otherwise '$env:VAR\n-Flag' is parsed
# as a single env-name 'VAR\n-Flag', the lookup misses, and the literal '$env:...\n'
# falls through to the sanitizer allowlist (which rejects '$').
@{
Name = 'Folded-scalar newline (LF) terminates env name'
Input = "`$env:VAR1`n-Flag"
Variables = @('VAR1=val1')
Expected = "val1`n-Flag"
},
@{
Name = 'Folded-scalar CRLF terminates env name'
Input = "`$env:VAR1`r`n-Flag"
Variables = @('VAR1=val1')
Expected = "val1`r`n-Flag"
},
@{
Name = 'Tab terminates env name'
Input = "`$env:VAR1`t-Flag"
Variables = @('VAR1=val1')
Expected = "val1`t-Flag"
},
@{
Name = 'Multiple env vars separated by newlines all expand'
Input = "`$env:VAR1`n`$env:VAR2`n`$env:VAR3"
Variables = @('VAR1=1', 'VAR2=2', 'VAR3=3')
Expected = "1`n2`n3"
},
@{
Name = 'Folded-scalar reproducer (multi-line arguments: > block)'
Input = "-SubscriptionId `$env:subId`n-Tenant `$env:tenantId`n-ClientSecret `$env:clientSecret"
Variables = @('subId=00000000-0000-0000-0000-000000000001', 'tenantId=00000000-0000-0000-0000-000000000002', 'clientSecret=supersecret')
Expected = "-SubscriptionId 00000000-0000-0000-0000-000000000001`n-Tenant 00000000-0000-0000-0000-000000000002`n-ClientSecret supersecret"
}
)

Expand Down
2 changes: 1 addition & 1 deletion Tasks/PowerShellOnTargetMachinesV3/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 3,
"Minor": 275,
"Patch": 0
"Patch": 1
},
"groups": [
{
Expand Down
2 changes: 1 addition & 1 deletion Tasks/PowerShellOnTargetMachinesV3/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 3,
"Minor": 275,
"Patch": 0
"Patch": 1
},
"groups": [
{
Expand Down
2 changes: 1 addition & 1 deletion Tasks/PowerShellV2/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 2,
"Minor": 275,
"Patch": 0
"Patch": 1
},
"releaseNotes": "Script task consistency. Added support for macOS and Linux.",
"minimumAgentVersion": "2.115.0",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/PowerShellV2/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 2,
"Minor": 275,
"Patch": 0
"Patch": 1
},
"releaseNotes": "ms-resource:loc.releaseNotes",
"minimumAgentVersion": "2.115.0",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/ServiceFabricPowerShellV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 1,
"Minor": 275,
"Patch": 0
"Patch": 1
},
"demands": [
"Cmd"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/ServiceFabricPowerShellV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 1,
"Minor": 275,
"Patch": 0
"Patch": 1
},
"demands": [
"Cmd"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/SqlAzureDacpacDeploymentV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"version": {
"Major": 1,
"Minor": 275,
"Patch": 0
"Patch": 1
},
"demands": [
"sqlpackage"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/SqlAzureDacpacDeploymentV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"version": {
"Major": 1,
"Minor": 275,
"Patch": 0
"Patch": 1
},
"demands": [
"sqlpackage"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/SqlDacpacDeploymentOnMachineGroupV0/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"version": {
"Major": 0,
"Minor": 275,
"Patch": 0
"Patch": 1
},
"demands": [],
"minimumAgentVersion": "1.102.0",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/SqlDacpacDeploymentOnMachineGroupV0/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"version": {
"Major": 0,
"Minor": 275,
"Patch": 0
"Patch": 1
},
"demands": [],
"minimumAgentVersion": "1.102.0",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/WindowsMachineFileCopyV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 1,
"Minor": 275,
"Patch": 0
"Patch": 1
},
"minimumAgentVersion": "1.104.0",
"groups": [
Expand Down
2 changes: 1 addition & 1 deletion Tasks/WindowsMachineFileCopyV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 1,
"Minor": 275,
"Patch": 0
"Patch": 1
},
"minimumAgentVersion": "1.104.0",
"groups": [
Expand Down
2 changes: 1 addition & 1 deletion Tasks/WindowsMachineFileCopyV2/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 2,
"Minor": 275,
"Patch": 0
"Patch": 1
},
"releaseNotes": "What's new in Version 2.0: <br/>&nbsp;&nbsp;Proxy support is being added. <br/>&nbsp;&nbsp; Removed support of legacy DTL machines.",
"minimumAgentVersion": "1.104.0",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/WindowsMachineFileCopyV2/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 2,
"Minor": 275,
"Patch": 0
"Patch": 1
},
"releaseNotes": "ms-resource:loc.releaseNotes",
"minimumAgentVersion": "1.104.0",
Expand Down
4 changes: 2 additions & 2 deletions _generated/AzureFileCopyV4.versionmap.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Default|4.275.0
Node24_1|4.275.1
Default|4.275.2
Node24_1|4.275.3
2 changes: 1 addition & 1 deletion _generated/AzureFileCopyV4/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 4,
"Minor": 275,
"Patch": 0
"Patch": 2
},
"demands": [
"azureps"
Expand Down
2 changes: 1 addition & 1 deletion _generated/AzureFileCopyV4/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 4,
"Minor": 275,
"Patch": 0
"Patch": 2
},
"demands": [
"azureps"
Expand Down
2 changes: 1 addition & 1 deletion _generated/AzureFileCopyV4_Node24/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 4,
"Minor": 275,
"Patch": 1
"Patch": 3
},
"demands": [
"azureps"
Expand Down
Loading
Loading