Skip to content

Commit 198c404

Browse files
authored
Merge pull request #1629 from microsoft/dpaul-CveDev
Block PowerShell Core from running with the script
2 parents 5ace923 + 6c73ae9 commit 198c404

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Security/src/CVE-2023-23397/CVE-2023-23397.ps1

+4
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,10 @@ begin {
701701
} end {
702702
Write-Host ("CVE-2023-23397 script version $($BuildVersion)") -ForegroundColor Green
703703

704+
if ($null -ne $PSVersionTable.PSEdition -and $PSVersionTable.PSEdition -eq "Core") {
705+
throw "Script doesn't support PowerShell Core, must use PowerShell Version 5 or lower"
706+
}
707+
704708
if (([System.String]::IsNullOrEmpty($CleanupInfoFilePath)) -and
705709
($ScriptUpdateOnly -eq $false) -and
706710
($UseSearchFolders -eq $false) -and

0 commit comments

Comments
 (0)