Skip to content

Commit b3dc3a1

Browse files
DCODEV1702DCODEV1702
DCODEV1702
authored and
DCODEV1702
committed
added GeoIPNonInteractive variable to Hawk Global Object to help determine code flow between interactive and non-interactive.
1 parent 4c0ce3d commit b3dc3a1

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

Hawk/internal/functions/Get-IPStackAPIKey.ps1

+2-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ function Get-IPStackAPIKey {
1919
[string]$newKey = $null
2020
[string]$AccessKeyFromFile = $null
2121
[string]$saveChoice = $null
22-
[bool]$AccessKeyValid = $false
23-
[bool]$GeoIPFromCommandLine = $Global:Hawk.EnableGeoIPLocation
24-
Out-LogFile "GeoIPFromCommandLine -> $GeoIPFromCommandLine" -Information
22+
[bool]$GeoIPFromCommandLine = $Global:Hawk.GeoIPNonInteractive
23+
Out-LogFile "IPSTACKIPKEY::GeoIPFromCommandLine: $GeoIPFromCommandLine" -Information
2524
}
2625

2726
process {

Hawk/internal/functions/Initialize-HawkGlobalObject.ps1

+8-6
Original file line numberDiff line numberDiff line change
@@ -238,13 +238,14 @@
238238

239239
# Create the global $Hawk variable immediately with minimal properties
240240
$Global:Hawk = [PSCustomObject]@{
241-
FilePath = $null # Will be set shortly
242-
DaysToLookBack = $null
243-
StartDate = $null
244-
EndDate = $null
245-
WhenCreated = $null
241+
FilePath = $null # Will be set shortly
242+
DaysToLookBack = $null
243+
StartDate = $null
244+
EndDate = $null
245+
WhenCreated = $null
246246
EnableGeoIPLocation = $null
247-
TenantName = $null
247+
TenantName = $null
248+
GeoIPNonInteractive = $false
248249
}
249250

250251
# Set up the file path first, before any other operations
@@ -565,6 +566,7 @@
565566

566567
if ($PSBoundParameters.ContainsKey('EnableGeoIPLocation')) {
567568
$Hawk.EnableGeoIPLocation = $EnableGeoIPLocation
569+
$Hawk.GeoIPNonInteractive = $true
568570
}
569571

570572

0 commit comments

Comments
 (0)