Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/154 dc 1 extend log retrieval period #232

Closed
Closed
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
08100d5
Create Test-HawkLicenseType to determine whether Tenant has E3 or E5 …
jonnybottles Jan 10, 2025
c3b9a31
Create Test-HawkLicenseType to determine whether Tenant has E3 or E5 …
jonnybottles Jan 10, 2025
c8c3788
Create Test-HawkLicenseType to determine whether Tenant has E3 or E5 …
jonnybottles Jan 10, 2025
b6dff23
Update Test-HawkLicenseType and add MaxAuditDays to Initialize-HawkGl…
jonnybottles Jan 10, 2025
a0bb88b
Removed Azure AD license check and associated variable as this is no …
jonnybottles Jan 10, 2025
516826c
Removed Azure AD license check and associated variable as this is no …
jonnybottles Jan 10, 2025
6014f62
Add prompt for user in the event they enter a day search range outsid…
jonnybottles Jan 10, 2025
95ba314
Update multiple functions to update the user with completion status.
jonnybottles Jan 10, 2025
de17ffd
Update multiple functions to update the user with completion status.
jonnybottles Jan 10, 2025
e0684f3
Update multiple functions to update the user with completion status.
jonnybottles Jan 10, 2025
292862c
Update multiple functions to update the user with completion status.
jonnybottles Jan 10, 2025
2d42e40
Update Get-HawkUserMailBoxAuditing to inform user of long wait periods.
jonnybottles Jan 11, 2025
6a0bfe9
Update Get-HawkUserMailBoxAuditing to inform user of long wait periods.
jonnybottles Jan 11, 2025
91ce086
Add check at beginning of intialize-hawkglobalobject to check for hal…
jonnybottles Jan 11, 2025
7c60ff4
Add check at beginning of intialize-hawkglobalobject to check for hal…
jonnybottles Jan 11, 2025
70b992a
Remove bug where program crashes if uses CTRL Cs at point of being as…
jonnybottles Jan 11, 2025
74d10dd
Add test-hawkglobalobject function and have every public function cal…
jonnybottles Jan 11, 2025
6a7a0be
Append investigation folder with seconds to avoid duplicate folder cr…
jonnybottles Jan 11, 2025
45d4abe
Change UTC to Z in timestamp format to conform to ISO 8601 standard a…
jonnybottles Jan 11, 2025
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
Prev Previous commit
Next Next commit
Remove bug where program crashes if uses CTRL Cs at point of being as…
…ked for start or end date.
jonnybottles committed Jan 11, 2025
commit 70b992a97bee05769d82d56b2d7107b80bf8b6af
21 changes: 20 additions & 1 deletion Hawk/internal/functions/Initialize-HawkGlobalObject.ps1
Original file line number Diff line number Diff line change
@@ -60,13 +60,32 @@
# call depth overflow errors from recursion.
# Attempted to put in its own function, but resulted in issues due to order of the call stack

# Validation to handle interrupted initialization states
# If Hawk initialization was interrupted (e.g., by CTRL+C during path input),
# it can leave behind a partially initialized Hawk object. This causes
# recursion errors on subsequent runs due to the partial state.
#
# Two cleanup scenarios:
# 1. Force parameter: Always remove any existing Hawk object
# 2. Incomplete object: Remove if missing essential properties
# (FilePath, StartDate, EndDate)
#
# This validation runs before any function definitions or calls to prevent
# call depth overflow errors from recursion.
# Attempted to put in its own function, but resulted in issues due to order of the call stack

if ($Force) {
Remove-Variable -Name Hawk -Scope Global -ErrorAction SilentlyContinue
}

# Then check if the Hawk object exists but is incomplete
if ($null -ne (Get-Variable -Name Hawk -ErrorAction SilentlyContinue) -and
($null -eq $Hawk.FilePath -or $null -eq $Hawk.StartDate -or $null -eq $Hawk.EndDate)) {
($null -eq $Hawk.FilePath -or
$null -eq $Hawk.StartDate -or
$null -eq $Hawk.EndDate -or
# Add additional checks for partially initialized date properties
($Hawk.PSObject.Properties.Name -contains 'StartDate' -and $null -eq $Hawk.StartDate) -or
($Hawk.PSObject.Properties.Name -contains 'EndDate' -and $null -eq $Hawk.EndDate))) {
Remove-Variable -Name Hawk -Scope Global -ErrorAction SilentlyContinue
}