Enable Developer Dashboard using PowerShell

Turn on Dashboard
When turned on, all the information like data base call, request, response, web part events are show in the screen.
Turn off Dashboard
When turned off, all the information dashboard information are hidden.
$dashsetting.DisplayLevel=[Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::OnDemand $dashsetting.Update()
When set to demand an icon is added to the top right corner next to the user id, which helps in toggle the on/off state of the Developer dashboard.
I have used SharePoint 2010 Management Shell, if you are using windows powershell please load the respective SharePoint 2010 snapin to proceed.