Hi All,
Reading of a CVS can be used to automate any functions. In this example, I am have unzipped the using the Orion Diag file to read the engines table. This is a simple example, and can be expanded upon - such as reading a CSV file to update Node custom properties.
The Engines.csv file was unzipped from the Orion Diag.

$csv = "D:\PS\DB\Engines.csv"
$provider = (New-Object System.Data.OleDb.OleDbEnumerator).GetElements() | Where-Object { $_.SOURCES_NAME -like "Microsoft.ACE.OLEDB.*" }
if ($provider -is [system.array]) { $provider = $provider[0].SOURCES_NAME } else { $provider = $provider.SOURCES_NAME }
$firstRowColumnNames = "Yes"
$delimiter = ","
$connstring = "Provider=$provider;Data Source=$(Split-Path $csv);Extended Properties='text;HDR=$firstRowColumnNames;';"
$tablename = (Split-Path $csv -leaf).Replace(".","#")
$sql = "SELECT ServerName, IP, ServerType, Elements, Nodes, Interfaces, VOlumes, PollingCompletion from [$tablename]"
$conn = New-Object System.Data.OleDb.OleDbconnection
$conn.ConnectionString = $connstring
$conn.Open()
$cmd = New-Object System.Data.OleDB.OleDBCommand
$cmd.Connection = $conn
$cmd.CommandText = $sql
# Load into datatable
$dt = New-Object System.Data.DataTable
$dt.Load($cmd.ExecuteReader("CloseConnection"))
# Clean up
$cmd.dispose | Out-Null; $conn.dispose | Out-Null
# Output results
$dt | Format-Table -AutoSize
Thank you,
Amit
Loop1 Systems