Skip to content

Commit 5862287

Browse files
authored
Revert changes for command execution (#14057)
1 parent e04d16e commit 5862287

File tree

8 files changed

+12
-12
lines changed

8 files changed

+12
-12
lines changed

Tasks/PowerShellV2/Tests/L0Args.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ let a: ma.TaskLibAnswers = <ma.TaskLibAnswers>{
4343
"code": 0,
4444
"stdout": "temp/path"
4545
},
46-
"path/to/powershell -NoLogo -NoProfile -NonInteractive -Command & 'temp\\path\\fileName.ps1'": {
46+
"path/to/powershell -NoLogo -NoProfile -NonInteractive -Command . 'temp\\path\\fileName.ps1'": {
4747
"code": 0,
4848
"stdout": "my script output"
4949
},
50-
"path/to/powershell -NoLogo -NoProfile -NonInteractive -Command & 'temp/path/fileName.ps1'": {
50+
"path/to/powershell -NoLogo -NoProfile -NonInteractive -Command . 'temp/path/fileName.ps1'": {
5151
"code": 0,
5252
"stdout": "my script output"
5353
}

Tasks/PowerShellV2/Tests/L0External.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ let a: ma.TaskLibAnswers = <ma.TaskLibAnswers>{
4242
"code": 0,
4343
"stdout": "temp/path"
4444
},
45-
"path/to/powershell -NoLogo -NoProfile -NonInteractive -Command & 'temp\\path\\fileName.ps1'": {
45+
"path/to/powershell -NoLogo -NoProfile -NonInteractive -Command . 'temp\\path\\fileName.ps1'": {
4646
"code": 0,
4747
"stdout": "my script output"
4848
},
49-
"path/to/powershell -NoLogo -NoProfile -NonInteractive -Command & 'temp/path/fileName.ps1'": {
49+
"path/to/powershell -NoLogo -NoProfile -NonInteractive -Command . 'temp/path/fileName.ps1'": {
5050
"code": 0,
5151
"stdout": "my script output"
5252
}

Tasks/PowerShellV2/Tests/L0Inline.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ let a: ma.TaskLibAnswers = <ma.TaskLibAnswers>{
4242
"code": 0,
4343
"stdout": "temp/path"
4444
},
45-
"path/to/powershell -NoLogo -NoProfile -NonInteractive -Command & 'temp\\path\\fileName.ps1'": {
45+
"path/to/powershell -NoLogo -NoProfile -NonInteractive -Command . 'temp\\path\\fileName.ps1'": {
4646
"code": 0,
4747
"stdout": "my script output"
4848
},
49-
"path/to/powershell -NoLogo -NoProfile -NonInteractive -Command & 'temp/path/fileName.ps1'": {
49+
"path/to/powershell -NoLogo -NoProfile -NonInteractive -Command . 'temp/path/fileName.ps1'": {
5050
"code": 0,
5151
"stdout": "my script output"
5252
}

Tasks/PowerShellV2/Tests/L0StdErr.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ let a: ma.TaskLibAnswers = <ma.TaskLibAnswers>{
5151
"code": 0,
5252
"stdout": "temp/path"
5353
},
54-
"path/to/powershell -NoLogo -NoProfile -NonInteractive -Command & 'temp\\path\\fileName.ps1'": {
54+
"path/to/powershell -NoLogo -NoProfile -NonInteractive -Command . 'temp\\path\\fileName.ps1'": {
5555
"code": 0,
5656
"stdout": "",
5757
"stderr": "myErrorTest" + generateBigString(1000)
5858
},
59-
"path/to/powershell -NoLogo -NoProfile -NonInteractive -Command & 'temp/path/fileName.ps1'": {
59+
"path/to/powershell -NoLogo -NoProfile -NonInteractive -Command . 'temp/path/fileName.ps1'": {
6060
"code": 0,
6161
"stdout": "",
6262
"stderr": "myErrorTest" + generateBigString(1000)

Tasks/PowerShellV2/powershell.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ try {
102102
$powershellPath = Get-Command -Name powershell.exe -CommandType Application | Select-Object -First 1 -ExpandProperty Path
103103
}
104104
Assert-VstsPath -LiteralPath $powershellPath -PathType 'Leaf'
105-
$arguments = "-NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command `"& '$($filePath.Replace("'", "''"))'`""
105+
$arguments = "-NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command `". '$($filePath.Replace("'", "''"))'`""
106106
$splat = @{
107107
'FileName' = $powershellPath
108108
'Arguments' = $arguments

Tasks/PowerShellV2/powershell.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ async function run() {
101101
.arg('-NoProfile')
102102
.arg('-NonInteractive')
103103
.arg('-Command')
104-
.arg(`& '${filePath.replace(/'/g, "''")}'`);
104+
.arg(`. '${filePath.replace(/'/g, "''")}'`);
105105
let options = <tr.IExecOptions>{
106106
cwd: input_workingDirectory,
107107
failOnStdErr: false,

Tasks/PowerShellV2/task.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"version": {
1919
"Major": 2,
2020
"Minor": 179,
21-
"Patch": 0
21+
"Patch": 1
2222
},
2323
"releaseNotes": "Script task consistency. Added support for macOS and Linux.",
2424
"minimumAgentVersion": "2.115.0",

Tasks/PowerShellV2/task.loc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"version": {
1919
"Major": 2,
2020
"Minor": 179,
21-
"Patch": 0
21+
"Patch": 1
2222
},
2323
"releaseNotes": "ms-resource:loc.releaseNotes",
2424
"minimumAgentVersion": "2.115.0",

0 commit comments

Comments
 (0)