Added support for audit-report in Power Commander.#371
Open
amandli-ks wants to merge 3 commits intoSDK-195-audit-report-relfrom
Open
Added support for audit-report in Power Commander.#371amandli-ks wants to merge 3 commits intoSDK-195-audit-report-relfrom
amandli-ks wants to merge 3 commits intoSDK-195-audit-report-relfrom
Conversation
| $auth = $enterprise.loader.Auth | ||
| } | ||
| catch { | ||
| Write-Error "Failed to retrieve audit report: $($_.Exception.Message)" -ErrorAction Stop |
| elseif ($useRegex) { | ||
| $filter.Type = 'Regex' | ||
| $filter.Pattern = $workingPattern | ||
| try { |
There was a problem hiding this comment.
can this be combined with previous similar condition
sgaddala-ks
reviewed
Feb 26, 2026
Contributor
sgaddala-ks
left a comment
There was a problem hiding this comment.
Along with the above mentioned changes, since we are going very regex heavy here, please add timeouts for regex parsing where appropriate.
| $auth = $enterprise.loader.Auth | ||
| } | ||
| catch { | ||
| Write-Error "Failed to retrieve audit report: $($_.Exception.Message)" -ErrorAction Stop |
Contributor
There was a problem hiding this comment.
Suggested change
| Write-Error "Failed to retrieve audit report: $($_.Exception.Message)" -ErrorAction Stop | |
| Write-Error "Failed to load enterprise context: $($_.Exception.Message)" -ErrorAction Stop |
| } | ||
| } | ||
| 'Exact' { | ||
| if ($value.Equals($filter.Pattern, [System.StringComparison]::OrdinalIgnoreCase)) { |
Contributor
There was a problem hiding this comment.
Suggested change
| if ($value.Equals($filter.Pattern, [System.StringComparison]::OrdinalIgnoreCase)) { | |
| if ([string]::Equals($value, $filter.Pattern, [System.StringComparison]::OrdinalIgnoreCase)) { |
this might be better, give it a thought
| $allEvents = $rs.Events | ||
|
|
||
| function getEventValue([System.Collections.Generic.Dictionary[string,object]] $evt, [string] $key) { | ||
| if ($evt.ContainsKey($key) -and $null -ne $evt[$key]) { return $evt[$key].ToString() } |
Contributor
There was a problem hiding this comment.
Suggested change
| if ($evt.ContainsKey($key) -and $null -ne $evt[$key]) { return $evt[$key].ToString() } | |
| if ($evt -is [System.Collections.IDictionary] -and $evt.ContainsKey($key) -and $null -ne $evt[$key]) { return $evt[$key].ToString() } |
|
|
||
| if ($Created) { | ||
| $predefinedFilters = @('today','yesterday','last_7_days','last_30_days','month_to_date','last_month','year_to_date','last_year') | ||
| $createdLower = $Created.ToLowerInvariant() |
Contributor
There was a problem hiding this comment.
Suggested change
| $createdLower = $Created.ToLowerInvariant() | |
| $createdLower = $Created.Trim().ToLowerInvariant() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.