title: Simulate button clicks in a windows form using powershell.
body: <p>I have a basic windows form application written in C# in Visual Studio that has some buttons that open windows with more buttons. It doesnt do anything useful, I'm using it to try simulate a series of button presses using powershell. </p>
  
  <p>I am trying to learn powershell, and I've been looking online to see how to use powershell to open the windows form exe and then click a button on the form, and then click another button in the window that pops up. </p>
  
  <p>So far I can open the executable, but that was very straight forward. </p>
  
  <p>I am thinking of  using the sendkeys method. Perhaps I could associate keyboard shortcuts with buttons and then have powershell type in those shortcuts. </p>
  
  <p>Or when the exe opens, powershell hits tab a certain amount of times until the button is focused and then hits enter. </p>
  
  <p>I'm sure there is an easier way to do this. Any guidance or pointers would be greatly appreciated.</p>