powershell - Set-Service fails when executing as part of a script but passes when running manually -


as part of script, have following code inside powershell module.

set-service -name $servicename -computername $computername -status $servicestatus -confirm:$false -verbose; 

when runs in script following error

set-service : service 'service name' cannot configured due following error: specified service not exist installed service 

but when running manually part of testing command runs without error.

set-service -name "service name" -computername "machine name" -status stopped -confirm:$false -verbose; 


Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -