registry - PowerShell: How To Use Standard Output In Place of Filename -
i'm writing c# class runs process (reg) export registry keys. reg requires specify filename export rather have output of reg directed standard output can capture directly in c# code (using process.standardoutput). there way in powershell specify standard output filename?
if have use reg program (rather use powershell query/dump registry - or in c# program itself), best going allow dump out temporary file, pipe contents of file standard out , capture in c# program way:
$guid = [guid]::newguid().tostring("n") reg export hkcu\software\microsoft\windows "$env:temp\$guid" | out-null get-content "$env:temp\$guid" remove-item "$env:temp\$guid"
in case not aware: using powershell, can navigate registry though part of file system. perhaps helpful in other regard?
cd hkcu:\software\microsoft\windows dir
Comments
Post a Comment