Ben, you're a wizard, that worked first time out :-) I know MBS is going to be unimpressed by you simply slinging me a landed fish, but it's nearly 6pm here so I am quite happy to accept!
Now to go back to my hotel and try and do a bit more PowerShell learning (after the football) Thanks all! On 16 April 2013 17:24, Ben Scott <[email protected]> wrote: > 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 > -- *James Rankin* Technical Consultant (ACA, CCA, MCTS) http://appsensebigot.blogspot.co.uk ~ 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
