title: How to insert text in a textbox on a website using Powershell
body: <p>I'm trying to insert text into the textbox of a website but I seem to be doing something incorrect because I keep getting an error in the Powershell IDE. The code I'm using is:</p>
  
  <pre><code>($ie.Document.DocumentElement.getElementsByClassName('web-password-input') | Select-Object -First 1).value = 'asdf'
  </code></pre>
  
  <p>The error it shows in the IDE is: </p>
  
  <pre><code>The property 'Value' cannot be found on this object. Verify that the property exists and can be set.
  At C:\Users\file.ps1:53 char:5
  +     ($ie.Document.DocumentElement.getElementsByClassName('web-passwor ...
  +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
      + FullyQualifiedErrorId : PropertyNotFound
  </code></pre>
  
  <p>I used this code earlier in the project and it worked correctly, granted this is to submit a button and not insert text.</p>
  
  <pre><code>$fs = $ie.Document.DocumentElement.getElementsByClassName('right-nav button button-link last') | Select-Object -first 1
  $fs.click()
  </code></pre>
  
  <p>The HTML code that I'm trying to target is:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;web-password-input aria-invalid="{errors.password.hasErrors}" errors="{errors.password}" input-id="password" aria-described-by="error-message1" focus="{pwdFocus}" ready="{passwordComponentReady}" classes="content-input" placeholder="new password" flow="{flow}" value="{password}" strength="{strength}" percentage="{percentage}" {password-policy}="passwordPolicy"&gt;    
      
    &lt;input class="pwd form-textbox form-textbox-text  override error has-errors content-input" id="password" aria-invalid="true" aria-required="true" aria-describedby="error-message1" type="password" placeholder="new password" autocomplete="off" can-field="{value}" errors="{errors}"&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Any advice or pointers you can provide would be greatly appreciated.</p>