PoshCode Archive  Artifact [d3616d28f1]

Artifact d3616d28f12608991f0df73973394135d923bee3ef623e8c2d34a4d2f3e827ef:

  • File Antivirus-path.ps1 — part of check-in [221b1c8328] at 2018-06-10 14:11:24 on branch trunk — This script returns a path where antivirus has been installed. It doesn’t use WMI (thanks a lot to greg zakharov for this trick). (user: Olivia Wild size: 731)

# encoding: ascii
# api: powershell
# title: Antivirus path
# description: This script returns a path where antivirus has been installed. It doesn’t use WMI (thanks a lot to greg zakharov for this trick).
# version: 0.1
# author: Olivia Wild
# license: CC0
# x-poshcode-id: 6246
# x-archived: 2016-10-18T13:19:25
# x-published: 2016-03-05T17:27:00
#
#
Get-ChildItem Registry::HKCR\CLSID | ForEach-Object {
  $x = (Get-ItemProperty 'Registry::HKCR\Component Categories\*' |
  Where-Object {$_ -match 'antivirus'}).PSChildName
}{
  if ((Get-ChildItem "$($_.PSPath)\Implemented Categories" -ea 0).PSChildName -eq $x) {
    Split-Path (Get-ItemProperty "$($_.PSPath)\InprocServer32").'(default)'
    break
  }
}