Popup message occurs when value is correct

Welcome Forums General PowerShell Q&A Popup message occurs when value is correct

Viewing 1 reply thread
  • Author
    Posts
    • #178095
      Participant
      Topics: 7
      Replies: 9
      Points: 102
      Rank: Participant

      The value from the .ini file does return correctly as shown in blue below. What I cannot figure out is why my message box is still popping up when the value IS Fujitsu fi-71* or 72*...I only want it to do so when the value selected and set in the .ini file is neither of the supported options.

      $Value = Get-Content -Path C:\ProgramData\Kofax\Vrs\kofax200.ini | Where-Object { $_ -match 'DefaultSource32' }
      $Value.Split('=')[1]

      If ($Value -notlike "Fujitsu fi-71*" -or "Fujitsu fi-72*"){
      $wshell = New-Object -ComObject Wscript.Shell
      $Output = $wshell.Popup("Model selection unsupported. Please re-open utility and choose Fujitsu 7160 or 7260")
      }
      Fujitsu fi-7160 with SVRS with AIPE

    • #178101
      Participant
      Topics: 2
      Replies: 1707
      Points: 3,428
      Helping Hand
      Rank: Community Hero

      Your condition is wrong ... should be something like this:

      $Value = 'Fujitsu fi-7160 with SVRS with AIPE'
      If ($Value -notlike "Fujitsu fi-71*" -and $Value -notlike "Fujitsu fi-72*"){
          $wshell = New-Object -ComObject Wscript.Shell
          $Output = $wshell.Popup("Model selection unsupported. Please re-open utility and choose Fujitsu 7160 or 7260")
      }
      • #178107
        Participant
        Topics: 7
        Replies: 9
        Points: 102
        Rank: Participant

        Thank you, Olaf. I greatly appreciate your help!

Viewing 1 reply thread
  • The topic ‘Popup message occurs when value is correct’ is closed to new replies.