To get the SharePoint 2010 sites name in an Excel file using Powershell,
Go to SharePoint 2010 Management Shell, right click - Run as Administrator
And type the following command at the PowerShell prompt:
Get-SPSite | Get-SPWeb | Select url,title | Export-Csv
After that, this will ask for Path. Provide any physical drive name with file name (e.g.: C:\Sites.csv)
This will export all the sites name in excel file.