Set-RemoteService

Sets service state for remote machines, single and from a list. start/stop/restart with a clean exportable format.

 
 
 
 
 
3.5 Star
(2)
Add to favorites
Operating System
11/1/2011
E-mail Twitter del.icio.us Digg Facebook
  • bug
    3 Posts | Last post September 26, 2013
    • Not sure what is causing this, any ideas?
      
      PS C:\script> . .\function.ps1
      
      PS C:\script> Set-RemoteService -STATE start -SERVICE remoteregistry -TARGET localhost
      
      Attempting to start remoteregistry
      -computername : The term '-computername' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a 
      path was included, verify that the path is correct and try again.
      At C:\script\function.ps1:21 char:21
      +                     -computername "$MACHINE" -ErrorAction continue
      +                     ~~~~~~~~~~~~~
          + CategoryInfo          : ObjectNotFound: (-computername:String) [], CommandNotFoundException
          + FullyQualifiedErrorId : CommandNotFoundException
      
    • On line 21, the escape character ` apparently didn't copy correctly.  It sees that line as calling -computername directly rather than as part of the previous line.
    • On line 21, the escape character ` apparently didn't copy correctly.  It sees that line as calling -computername directly rather than as part of the previous line.
      
      I apologize for not seeing this question sooner.  I'm normally notified by email for discussions around my contributions but never saw a notice for your question.