From 842dd4e3dc1a998dc5685d4655a7066778f73164 Mon Sep 17 00:00:00 2001 From: Jonathan Butler Date: Sun, 8 Dec 2024 11:16:41 -0500 Subject: [PATCH] Remove AzureAD from Hawk.psd1 and delecte Test-AzureADConnection.ps1 as it is no longer required. --- Hawk/Hawk.psd1 | 1 - .../functions/Test-AzureADConnection.ps1 | 49 ------------------- 2 files changed, 50 deletions(-) delete mode 100644 Hawk/internal/functions/Test-AzureADConnection.ps1 diff --git a/Hawk/Hawk.psd1 b/Hawk/Hawk.psd1 index 36f64e4..2b53c63 100644 --- a/Hawk/Hawk.psd1 +++ b/Hawk/Hawk.psd1 @@ -31,7 +31,6 @@ @{ModuleName = 'PSFramework'; ModuleVersion = '1.12.346' }, @{ModuleName = 'PSAppInsights'; ModuleVersion = '0.9.6' }, @{ModuleName = 'ExchangeOnlineManagement'; ModuleVersion = '3.0.0' }, - @{ModuleName = 'AzureAD'; ModuleVersion = '2.0.2.182' }, @{ModuleName = 'Microsoft.Graph.Authentication'; ModuleVersion = '2.25.0' }, @{ModuleName = 'Microsoft.Graph.Identity.DirectoryManagement'; ModuleVersion = '2.25.0' } ) diff --git a/Hawk/internal/functions/Test-AzureADConnection.ps1 b/Hawk/internal/functions/Test-AzureADConnection.ps1 deleted file mode 100644 index b17ea9f..0000000 --- a/Hawk/internal/functions/Test-AzureADConnection.ps1 +++ /dev/null @@ -1,49 +0,0 @@ -<# -.SYNOPSIS - Test if we have a connection with the AzureAD Cmdlets -.DESCRIPTION - Test if we have a connection with the AzureAD Cmdlets -.EXAMPLE - PS C:\> - Explanation of what the example does -.INPUTS - Inputs (if any) -.OUTPUTS - Output (if any) -.NOTES - General notes -#> -Function Test-AzureADConnection { - - $TestModule = Get-Module AzureAD -ListAvailable -ErrorAction SilentlyContinue - $MinimumVersion = New-Object -TypeName Version -ArgumentList "2.0.2.140" - - if ($null -eq $TestModule) { - Out-LogFile "Please Install the AzureAD Module with the following command:" - Out-LogFile "Install-Module AzureAD" - break - } - # Since we are not null pull the highest version - else { - $TestModuleVersion = ($TestModule | Sort-Object -Property Version -Descending)[0].version - } - - # Test the version we need at least 2.0.2.140 - if ($TestModuleVersion -lt $MinimumVersion) { - Out-LogFile ("AzureAD Module Installed Version: " + $TestModuleVersion) - Out-LogFile ("Miniumum Required Version: " + $MinimumVersion) - Out-LogFile "Please update the module with: Update-Module AzureAD" - break - } - # Do nothing - else { } - - try { - $Null = Get-AzureADTenantDetail -ErrorAction Stop - } - catch [Microsoft.Open.Azure.AD.CommonLibrary.AadNeedAuthenticationException] { - #Out-LogFile "Please connect to AzureAD prior to running this cmdlet" - Out-LogFile "Connecting-AzureAD" - Connect-AzureAD - } -} \ No newline at end of file