问题描述
我为什么要出现这个错误?
how come I am geting this error ?
MEthod调用失败,因为[System.Object []]不包含名为'startservice'的方法
MEthod invocation failed because [System.Object[]] doesnt contain a method named 'startservice'
$ servicename = get-wmiobject win32_service -computername $ server |其中{$ _。Displaindame -match" Netbackup" |" Symantec" -and $ _。startmode -eq" auto"}
$servicename = get-wmiobject win32_service -computername $server | where {$_.Displayname -match "Netbackup"|"Symantec" -and $_.startmode -eq "auto"}
$ servicename.startservice()
$servicename.startservice()
推荐答案
做一些基本的事情通过管道到Get-Member来查看可用的内容进行故障排除。
Do some basic troubleshooting by looking at what's available to you by piping to Get-Member.
这篇关于$ servicename.Startservice()不包含名为'startservice'的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!