Question: how to extract data from excel using powershell?
Answer: $objExcel = New-Object -ComObject Excel.Application.
$WorkBook = $objExcel.Workbooks.Open ($ExcelFile)
$WorkBook.sheets | Select-Object -Property Name.
$WorkSheet = $WorkBook.Sheets.Item(1)
$totalNoOfRecords = ($WorkSheet.UsedRange.Rows).count.