Search code examples
powershellsc

Powershell script replace sc config


Good Day,

i look for a same command as

sc config BITS type= own in Powershell. I think ist with set-service -name BITS -computername server1234 -idon´t know

I have the problem that my INVOKE-COMMAND don´t work. But all scripts work only this line don´t work.

Invoke-Command -ComputerName $serverneedhelp -ScriptBlock {Start-Process cmd -ArgumentList "/c 'sc config bits type= own'"}

If anybody can help me, it is were so great. Thankyou

Greeting Jan


Solution

  • in my script work it with

    Invoke-Command -ComputerName $serverneedhelp -ScriptBlock {Start-Process cmd  -ArgumentList "/c sc config bits type= own"}
    

    But I search a version of Powershell without cmd