title: Not able to get status of service powershell
body: <p>I have a list of services in a text file. I am using that from Get-Content like below. But its not working while taking service from file. When just using get-service Service* and using below code it works. Please help me to fix the code with changes . <strong>Set-Service</strong> Line and the <strong>if condition</strong> line as <strong>.Status and .Name</strong> not working</p>
  
  <pre><code>$TEST= Get-Content "Somelocation\service.txt"
  
  foreach ($service in $TEST )
  {
  
      if($**service.Status** -eq "Stopped")
      {
                Set-Service $**service.Name** -StartupType Manual
                "Starting  $service"
                start-service $service -WarningAction SilentlyContinue
  
      }
      else
      {
          "$service was already started."
      }
  }
  </code></pre>
  
  <p>Note: I tried using ** to make word bold but not happen inside code</p>