Skip to content

Commit d4c8f95

Browse files
authored
add option to supress printing of atomicsfolder to screen (#141)
1 parent cb183eb commit d4c8f95

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

Public/Invoke-AtomicRunner.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function Invoke-AtomicRunner {
3131
$LoggingModule,
3232

3333
[Parameter(Mandatory = $false)]
34-
$listOfAtomics,
34+
$ListOfAtomics,
3535

3636
[Parameter(Mandatory = $false, ValueFromRemainingArguments = $true)]
3737
$OtherArgs
@@ -61,10 +61,10 @@ function Invoke-AtomicRunner {
6161
$sc = $tr.AtomicsFolder
6262
#Run the Test based on if scheduleContext is 'private' or 'public'
6363
if (($sc -eq 'public') -or ($null -eq $sc)) {
64-
Invoke-AtomicTest $tr.Technique -TestGuids $tr.auto_generated_guid -InputArgs $tr.InputArgs -TimeoutSeconds $tr.TimeoutSeconds -ExecutionLogPath $artConfig.execLogPath -PathToAtomicsFolder $artConfig.PathToPublicAtomicsFolder @htvars -Cleanup:$Cleanup
64+
Invoke-AtomicTest $tr.Technique -TestGuids $tr.auto_generated_guid -InputArgs $tr.InputArgs -TimeoutSeconds $tr.TimeoutSeconds -ExecutionLogPath $artConfig.execLogPath -PathToAtomicsFolder $artConfig.PathToPublicAtomicsFolder @htvars -Cleanup:$Cleanup -supressPathToAtomicsFolder
6565
}
6666
elseif ($sc -eq 'private') {
67-
Invoke-AtomicTest $tr.Technique -TestGuids $tr.auto_generated_guid -InputArgs $tr.InputArgs -TimeoutSeconds $tr.TimeoutSeconds -ExecutionLogPath $artConfig.execLogPath -PathToAtomicsFolder $artConfig.PathToPrivateAtomicsFolder @htvars -Cleanup:$Cleanup
67+
Invoke-AtomicTest $tr.Technique -TestGuids $tr.auto_generated_guid -InputArgs $tr.InputArgs -TimeoutSeconds $tr.TimeoutSeconds -ExecutionLogPath $artConfig.execLogPath -PathToAtomicsFolder $artConfig.PathToPrivateAtomicsFolder @htvars -Cleanup:$Cleanup -supressPathToAtomicsFolder
6868
}
6969
}
7070

Public/Invoke-AtomicTest.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,20 @@ function Invoke-AtomicTest {
111111
[Parameter(Mandatory = $false,
112112
ParameterSetName = 'technique')]
113113
[String]
114-
$LoggingModule
114+
$LoggingModule,
115+
116+
[Parameter(Mandatory = $false,
117+
ParameterSetName = 'technique')]
118+
[switch]
119+
$SupressPathToAtomicsFolder = $false
115120

116121
)
117122
BEGIN { } # Intentionally left blank and can be removed
118123
PROCESS {
119124
$PathToAtomicsFolder = (Resolve-Path $PathToAtomicsFolder).Path
120125

121126
Write-Verbose -Message 'Attempting to run Atomic Techniques'
122-
Write-Host -ForegroundColor Cyan "PathToAtomicsFolder = $PathToAtomicsFolder`n"
127+
if(-not $supressPathToAtomicsFolder) { Write-Host -ForegroundColor Cyan "PathToAtomicsFolder = $PathToAtomicsFolder`n" }
123128

124129
$executionPlatform, $isElevated, $tmpDir, $executionHostname, $executionUser = Get-TargetInfo $Session
125130
$PathToPayloads = if ($Session) { "$tmpDir`AtomicRedTeam" } else { $PathToAtomicsFolder }

0 commit comments

Comments
 (0)