title: How to verify the node value and based on condition log the value?
body: <p>I am having xml files which has following structure.</p>
  
  <pre><code> &lt;NodeData&gt;
        &lt;XPath&gt;//VersionInfo/VersionList[Name = "FileCopy"]&lt;/XPath&gt;
        &lt;Node&gt;
          &lt;VersionList xmlns=""&gt;
            &lt;Name&gt;Core_FileCopy&lt;/Name&gt;
            &lt;Version&gt;10.21.1.3&lt;/Version&gt;
          &lt;/VersionList&gt;
        &lt;/Node&gt;
      &lt;/NodeData&gt;
  </code></pre>
  
  <p>I am taking the values version and Name and store them in log file.</p>
  
  <pre><code>    $FileList= Get-Childitem -path "Z:\XmlFiles" -Include "*.xml" -recurse | ?{$_.GetType() -ne [System.IO.DirectoryInfo]} 
      $LikeArray = @("10.21.*","10.20.*","10.11.*")
  
      Foreach ( $File in $Filelist ) { 
  
          "Processing file $File.FullName"
          $xmldata= [xml] (Get-content $File.FullName);  
          $VersionLists = $xmldata.SelectNodes("//VersionList")    # Get the versionlist node
  
          # If it has VersionList node
          If ( $VersionLists -ne $null) {
  
              Foreach ($VersionList in $VersionLists) { 
  $VersionList | Select Version | Where-Object {$_ -notlike $LikeArray }
              }
  
          }
      }
  </code></pre>
  
  <p>But I need to store both name and version only if it does not have the version numbers  </p>
  
  <blockquote>
    <p>("10.21.<em>","10.20.</em>","10.11.*).</p>
  </blockquote>
  
  <p>I have modified my condition but still it displays all the version number</p>