0 Replies Latest reply on May 27, 2014 8:48 AM by leinhard

    Anyone can give me an idea for the powershell

    leinhard

      Dear, Team

      solution is very good to find a text in the line.

      Can you give me an idea that.

       

      ====script snippet====

      $lines = @()

      $txt1 = "Chassis-1"

      $txt2 = "PS-1"

      foreach ($line in $orgtxt) {

       

         switch -wildcard ($line)

         {

       

           "*$txt1*" {$lines += $line.Trim()} <== Variables not seems be working here

           "*txt2*" {$lines += $line.Trim()} <== Variables not seems be working here

         }

      }

      $lines

      ====script====


      above script is not working,,,,,how can i make it working..?? give me an idea plz.

      Best Regards.