$message = "Do you want to update and enable Windows Defender?"
$yes = New-Object System.Management.Automation.Host.ChoiceDescription "&Yes", `
  "Updates and enables 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 {
    Import-Module Defender -ErrorAction 'SilentlyContinue'
    if ((Get-Command -Module Defender) -eq $null) {
      ''
      'ONLY UPDATE AVAILABLE'
      ''
      & '.\anti-malware_7.ps1'
      exit
    }
    Update-MpSignature -UpdateSource MicrosoftUpdateServer
    Set-MpPreference -DisableRealtimeMonitoring $False
    Set-MpPreference -ScanParameters FullScan
    Set-MpPreference -ScanScheduleDay Monday
    Set-MpPreference -ScanScheduleTime 720
    Set-MpPreference -ScanOnlyIfIdleEnabled $False
    Set-MpPreference -DisableCatchupFullScan $True
    Set-MpPreference -SignatureScheduleDay Everyday
    Set-MpPreference -SignatureScheduleTime 660
    Set-MpPreference -SignatureUpdateCatchupInterval 1
    Set-MpPreference -ScanPurgeItemsAfterDelay 180
  }
}
