title: In powershell passing variable to where-object not working
body: <p>Its very basic Here is what I am trying to accomplish:</p>
  
  <pre><code>#Make a list of programs depending on Input
  
  get-service  | Where-Object {$_.name -Like $Input}| select-object name,  DisplayName, ServiceType, Status
  
  get-service  | Where-Object {$_.name -Like "Sys*"}| select-object name, DisplayName, ServiceType, Status
  </code></pre>
  
  <p>Now the second get-service works no problem. But the first one does not cooperate with me, it just throws all the services on the server.</p>
  
  <p>I obtain the user input with this:</p>
  
  <pre><code>$Input = Read-Host -Prompt 'Input your regex'
  </code></pre>
  
  <p>So what is going on here. Where have I gone wrong? And no, I test the variable with a write-host, the string is there. Its not disappearing as far as I can tell.</p>