Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Get string to variable - parse

$
0
0

Hello,

I have a value at variable:

PolyMES.DEV_20130814.1 Quality Changed To Staging Poly MES 3.0 (http://zserver/srutjgg

I only want to have the value after Changed To and (http) at variable.

How can I do this, i tried:

cls
$emailcontent = Get-Content "C:\inetpub\mailroot\Queue\0c1746bf01ce98eb00000001+mailcontent.txt"
# $emailcontent
$BuildQualityChange = [regex]::match($emailcontent,'(Quality\sChanged\sTo\s)(.+)(\s\(http)').Groups[2].value
$BuildQualityChange

But the value at variable $BuildQualityChange is:

Staging Poly MES 3.0 (http://zserver/srutjgg

I only want have: Staging Poly MES 3.0

How can I do this?


Thanks Horst MOSS 2007 Farm; MOSS 2010 Farm; TFS 2010; IIS 7.5


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>