Parsing Excel document using PowerShell

$xlsFilePath = "C:\Excel_file.xlsx"

$xl = New-Object -comobject Excel.Application
$xl.Visible = $False
$xl.DisplayAlerts = $False
$wb = $xl.WorkBooks.Open($xlsFilePath)
$ws = $wb.Worksheets.Item(1)

$value = $ws.Cells.Item(1, "A").Value2
Write-Host $value
# ...

$wb.Close($false)
$xl.Quit()

[System.GC]::Collect()
[System.GC]::WaitForPendingFinalizers()
[System.Runtime.Interopservices.Marshal]::ReleaseComObject($xl) | Out-Null

Generic serialization/deserialization

        public static void Serialize<T>(String file, T data)
        {
            XmlSerializer serializer = new XmlSerializer(typeof(T));
            using (StringWriter writer = new StringWriter())
            {
                serializer.Serialize(writer, data);
                File.WriteAllText(file, writer.ToString());
            }
        }

        public static T Deserialize<T>(String file)
        {
            String xml = File.ReadAllText(file);
            XmlSerializer serializer = new XmlSerializer(typeof(T));
            using (StringReader reader = new StringReader(xml))
            {
                return (T)(serializer.Deserialize(reader));
            }
        }