title: PowerShell - Password Generator - How to always include number in string?
body: <p>I have the following PowerShell script that creates a random string of 15 digits, for use as an Active Directory password.</p>
  
  <p>The trouble is, this works great most of the time, but on some occasions it doesn't use a number or symbol. I just get 15 letters. This is then not usable as an Active Directory password, as it must have at least one number or symbol in it.</p>
  
  <pre><code>$punc = 46..46
  $digits = 48..57
  $letters = 65..90 + 97..122
  $YouShallNotPass = get-random -count 15 `
  -input ($punc + $digits + $letters) |
  % -begin { $aa = $null } `
  -process {$aa += [char]$_} `
  -end {$aa}
  
  Write-Host "Password is $YouShallNotPass"
  </code></pre>
  
  <p>How would I amend the script to always have at least one random number or symbol in it?</p>
  
  <p>Thank you.</p>