Import-Module Defender -ErrorAction 'SilentlyContinue'
if ((Get-Command -Module Defender) -ne $null) {
  & '.\anti-malware_8.1.ps1'
} else {
  $message = 'Do you want to update Windows Defender? (it will launch Windows Defender)'

  $yes = New-Object System.Management.Automation.Host.ChoiceDescription "&Yes", `

    "Updates Windows Defender."
  $no = New-Object System.Management.Automation.Host.ChoiceDescription "&No", `

    "Does nothing."

  $options = [System.Management.Automation.Host.ChoiceDescription[]]($yes, $no)

  $result = $host.ui.PromptForChoice($title, $message, $options, 1)

  switch ($result) {
  
    0 {

      & 'C:\Program Files\Windows Defender\MSASCui.exe' -Update

    }

  }
  ''

  'Please, configure Windows Defender manually.'
  ''
}
