title: Append multiple parameters in Where-Object
body: <p>In my design, I encounter a problem, that is:</p>
  
  <p>in database, Form table A, I defined a variable name "MyParams", its value is "1,2,3", or "2,3,5" or "5,6,9", that is, the variable will change based on the business logic.</p>
  
  <p>In powershell, below script will deal with some text splitted by ~, it will check if the columns which extract from variable "MyParams" in database is blank, if any columns with blank value, it will exclude this record.</p>
  
  <pre><code>    Get-Content "${myFile}.tmp" | Where-Object { $_.Split("~")[1] -ne "" -and $_.Split("~")[2] -ne "" -and $_.Split("~")[3] -ne ""  }|Out-File $myFile -Encoding ASCII 
  </code></pre>
  
  <p>here , the numbers (1,2,3) in $<em>.Split("~")[1] $</em>.Split("~")[2] $_.Split("~")[3] come from variable "MyParams" which is configed in database.</p>
  
  <p>my problem is, the MyParams's value is often change, How can I originize my above code to adjust this ? </p>
  
  <p>I think maybe I need to use foreach-object inner Where-object , corrct? anyone can help me? thx.</p>