diff --git a/src/PSAppDeployToolkit/Public/Get-ADTApplication.ps1 b/src/PSAppDeployToolkit/Public/Get-ADTApplication.ps1 index 34df6bfadf5..393d68c6868 100644 --- a/src/PSAppDeployToolkit/Public/Get-ADTApplication.ps1 +++ b/src/PSAppDeployToolkit/Public/Get-ADTApplication.ps1 @@ -178,7 +178,7 @@ function Get-ADTApplication # Define compiled regex for use throughout main loop. $updatesAndHotFixesRegex = [System.Text.RegularExpressions.Regex]::new('((?i)kb\d+|(Cumulative|Security) Update|Hotfix)', [System.Text.RegularExpressions.RegexOptions]::IgnoreCase -bor [System.Text.RegularExpressions.RegexOptions]::Compiled) - $msiUpgradeCodeLookupTable = Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UpgradeCodes\* | Get-ItemProperty | & { + $msiUpgradeCodeLookupTable = Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UpgradeCodes\* -ErrorAction Ignore | Get-ItemProperty | & { begin { # Open lookup table dictionary for returning at the end.