Skip to content

Commit

Permalink
fix prereq bug for multi-line powershell (#815)
Browse files Browse the repository at this point in the history
* move emond test into correct T#

* only show cleanup with inputs if there are inputs

* fix prereq bug for multi-line powershell

Co-authored-by: Tony M Lambert <[email protected]>
Co-authored-by: Michael Haag <[email protected]>
  • Loading branch information
3 people authored Jan 29, 2020
1 parent 373f1b6 commit 196b2ae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Invoke-AtomicRedTeam/Private/Invoke-CheckPrereqs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function Invoke-CheckPrereqs ($test, $isElevated, $customInputArgs, $PathToAtomi
foreach ($dep in $test.dependencies) {
$executor = Get-PrereqExecutor $test
$final_command = Merge-InputArgs $dep.prereq_command $test $customInputArgs $PathToAtomicsFolder
$final_command = ($final_Command.trim()).Replace("`n", " && ")
if($executor -ne "powershell") { $final_command = ($final_Command.trim()).Replace("`n", " && ") }
$res = Invoke-ExecuteCommand $final_command $executor $TimeoutSeconds
$description = Merge-InputArgs $dep.description $test $customInputArgs $PathToAtomicsFolder
if ($res -ne 0) {
Expand Down
2 changes: 1 addition & 1 deletion Invoke-AtomicRedTeam/Public/Invoke-AtomicTest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ function Invoke-AtomicTest {
$description = (Merge-InputArgs $dep.description $test $InputArgs $PathToAtomicsFolder).trim()
Write-KeyValue "Attempting to satisfy prereq: " $description
$final_command_prereq = Merge-InputArgs $dep.prereq_command $test $InputArgs $PathToAtomicsFolder
$final_command_prereq = ($final_command_prereq.trim()).Replace("`n", " && ")
if($executor -ne "powershell") { $final_command_prereq = ($final_command_prereq.trim()).Replace("`n", " && ") }
$final_command_get_prereq = Merge-InputArgs $dep.get_prereq_command $test $InputArgs $PathToAtomicsFolder
$res = Invoke-ExecuteCommand $final_command_prereq $executor $TimeoutSeconds

Expand Down

0 comments on commit 196b2ae

Please sign in to comment.