Question: I have minimum to none knowledge of powershell :(

Hi I have two possible options to replace text from an .ini file, one is a menu-style batch, where choosing an option will execute a command.

My problem is: if I use the batch code I can only change a known resolution, because I don't know how to add multiple replace actions so they work if one fails.

The Powershell code does executes MULTIPLE replace commands, but I don't know how to edit it to use it as a batch command (`powershell -command` etc.) 

Thank you in advance :)

Batch script:

```
@echo off
set ffile='resolutions.ini'
set HDReady='/resolution:1280,720'
set FullHD='/resolution:1920,1080'
set QuadHD='/resolution:2560,1440'
set UltraHD='/resolution:3840,2160'
powershell -Command "(gc %ffile%) -replace %hdready%, %fullhd% | Out-File %ffile% -encoding utf8"

```

Powershell script:

```
$original_file = 'path\resolutions.ini'
$destination_file =  'path\resolutions.ini'
(Get-Content $original_file) | Foreach-Object {
    $_ -replace '/resolution:1280,720', '/resolution:1920,1080' `
       -replace '/resolution:2560,1440', '/resolution:1920,1080' `
       -replace '/resolution:3840,2160', '/resolution:1920,1080' 
    } | Set-Content $destination_file

```

Answer: 
Your solution above would also return documents where the field is null, which you don't want I guess. So the correct solution would be this one:

```
GET memoire/_search/?
{
  "query": {
    "bool": {
      "filter": {
        "exists": {
          "field": "test"
        }
      },
      "must_not": {
        "term": {
          "test.keyword": ""
        }
      }
    }
  }
}

```
Here is a solution. Use `must_not` with `term` query. This should work:

```
GET memoire/_search/?
{
  "query": {
    "bool": {
      "must_not": {
        "term": {"IMG.keyword": ""}
      }
    }
  }
}

```