Skip to content

Improve AzureAD module check by getting rid of Get-InstalledModule call#1597

Merged
dpaulson45 merged 3 commits into
mainfrom
lusassl-CVE202323397-U3
Mar 17, 2023
Merged

Improve AzureAD module check by getting rid of Get-InstalledModule call#1597
dpaulson45 merged 3 commits into
mainfrom
lusassl-CVE202323397-U3

Conversation

@lusassl-msft
Copy link
Copy Markdown
Contributor

@lusassl-msft lusassl-msft commented Mar 17, 2023

Description:
The current approach doesn't work properly if the AzureAD module wasn't installed via PowerShellGet.

Reason:
Get-InstalledModule works only with modules that were installed by PowerShellGet.
https://learn.microsoft.com/powershell/module/powershellget/get-installedmodule?view=powershell-7.3

Fix:
Try to import the module and properly handle the System.IO.FileNotFoundException exception.

Resolve #1595

Validation:
Lab
image

@dpaulson45 dpaulson45 merged commit 0db69a6 into main Mar 17, 2023
@dpaulson45 dpaulson45 deleted the lusassl-CVE202323397-U3 branch March 17, 2023 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Issue] CVE-2023-23397 - script doesnt recognize installed AzureAD Module

3 participants