On Tue, Apr 16, 2013 at 12:07 PM, James Rankin <[email protected]> wrote:
> I've managed to use Select-String to get my output and my variable, it's
> splitting the variable up (from something like ClientOS=ThinOS_Wyse down to
> just ThinOS_Wyse) that's frying my brain now.

  Ah, I ass-umed the separator was whitespace.  My bad.  Try this:

$match = & CTXCliOS.exe | Select-String -Pattern 'ClientOS=(.+)'
if($match) {
        $clientOS = $match.Matches[0].Groups[1].Value
        Set-ItemProperty -Path 'HKCU:\Software\Custom' -Name ClientOS -Value 
$clientOS
}

  Same caveats as before apply.  :)

-- Ben

~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

---
To manage subscriptions click here: 
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to [email protected]
with the body: unsubscribe ntsysadmin

Reply via email to