79185896

Date: 2024-11-13 16:57:41
Score: 1
Natty:
Report link

without try .. catch, an arror message is inevitably displaying if COM Object doesn't exist ... the following code doesn't display any error message :

try {
    $ie = New-Object -ComObject InternetExplorer.Application
}
catch {
    $ie = $null
}

# check and continuation
if (!$ie) {
    ...
}
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: DjiPih