If the conditions in the KB are met, you could use the following
$cimOff = @{
rulesetid = 'CIMSLP'
enabled = $false
}
Get-VMHost -PipelineVariable esx |
ForEach-Object -Process {
$esxcli = Get-EsxCli -VMHost $esx -V2
if(($esxcli.network.firewall.ruleset.list.Invoke(@{rulesetid = 'CIMSLP'})).Enabled){
$esxcli.network.firewall.ruleset.set.Invoke($cimOff)
}
}
But be aware that this does not do the check if the SLP service is active.
Further, the command to stop the service (/etc/init.d/slpd stop) will need to be done through an SSH session.
The same goes for the command (chkconfig) to make the change persistent through reboots.
For an SSH session, if that is an option for you, you can use the Posh-Sssh module.
See for example my Use Posh-SSH instead of PuTTY dive.