Skip to content

Commit

Permalink
Add check at beginning of intialize-hawkglobalobject to check for hal…
Browse files Browse the repository at this point in the history
…f initlized hawk object. Revert back to word tagging instead of symbol tagging.
  • Loading branch information
jonnybottles committed Jan 11, 2025
1 parent 91ce086 commit 7c60ff4
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions Hawk/internal/functions/Initialize-HawkGlobalObject.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,9 @@
# Create the global $Hawk variable immediately with minimal properties
$Global:Hawk = [PSCustomObject]@{
FilePath = $null # Will be set shortly
DaysToLookBack = $null
StartDate = $null
EndDate = $null
DaysToLookBack = 90
StartDate = ((Get-Date).ToUniversalTime().AddDays(-90)).Date # 90 days back in UTC
EndDate = (Get-Date).ToUniversalTime().Date # Today's date in UTC
WhenCreated = $null
}

Expand Down Expand Up @@ -234,9 +234,6 @@

Test-GraphConnection

# If the global variable Hawk doesn't exist or we have -force then set the variable up
Out-LogFile -string "Setting Up initial Hawk environment variable" -NoDisplay

try {
$LicenseInfo = Test-LicenseType
$MaxDaysToGoBack = $LicenseInfo.RetentionPeriod
Expand Down

0 comments on commit 7c60ff4

Please sign in to comment.