Are you trying to re-invent PI SMT?
To me the Process class in .NET is a convenient way to exchange information with command line tools like piconfig.exe and pidiag.exe
If you prefer the PowerShell approach, OSIsoft.PowerShell module is installed with PI SMT starting with a certain release (sorry, but it again comes back to PI SMT ).
$yourPIServerName = "yourPIServerHostName" $yourPI = Connect-PIDataArchive -PIDataArchiveMachineName $yourPIServerName -AuthenticationMethod Trust Get-PIArchiveFileInfo -Connection $yourPI
Please accept my apologies. Pidiag.exe is the archive offline utility. It requires archives not being actually registered to a running server. PI SMT and the Get-PIArchiveFileInfo PowerShell command expect archives being online, registered to a running PI Data Archive. For this reason, the only option to get an archive header dump from offline archives that remains is pidiag.exe and to do this programmatically, using the .NET Process class appears to be a good choice.