title: Powershell datagridview cell click event
body: <p>I have a powershell script in that script i am using datagridview. 
  My script is working fine. All looks ok to me.</p>
  
  <p>My issue is i want to get the first column value of selected row. To fulfill this i need to add event (cell click/cell content click/cell mouse click). I am not able to figure it out. How to add event.</p>
  
  <p>Can somebody please advise me on this?</p>
  
  <pre><code> $datagridview1_CellMouseClick = [System.Windows.Forms.DataGridViewCellEventHandler]{
  
  write-host $_.RowIndex # This displays the row number selected
  write-host $_.ColumnIndex # This displays the column number selected
  write-host $datagridview1.Rows[$_.RowIndex].Cells[0].value # This would display the value of the first cell in the selected row
  write-host $datagridview1.Rows[$_.RowIndex].Cells[$_.ColumnIndex].value # This would display the value of the cell selected
  }
  </code></pre>
  
  <p>There are plenty of example availble for C# but not found anything for powershell.</p>