banshee est en développement actif : les collecteurs vont encore changer, et une version que vous publiez demandera sans doute des ajustements. Pour un usage stable, attendez la version 1.0.0.

Examples

banshee/examples-collection/examples/protocols/

winrm-run

Example: winrm.run, a PowerShell script over WinRM; the state of a Windows service.

  • example
  • protocol
  • winrm
  • windows
  • powershell

par banshee1 installation1 version

v1Dernière

Publiée le 27 octobre 2026. First version in this collection.

Keen 1.0.0 · 14 lignes
// winrm.run: run a PowerShell script on a Windows, by WinRM over HTTPS. It returns output, errors and
// exit, as ssh.run does; WinRM starts PowerShell itself, so the script is written as it is.
// The collector reads the state of the print spooler.
need('protocol:winrm');

output('state', 'text', array('label' => 'State of the print spooler'));

watch.expect('stopped', 'Spooler not running', 'state', array('critical' => array('Running')));

$answer = winrm.run('(Get-Service -Name Spooler).Status.ToString()');
if ($answer['exit'] != 0) {
    fail('misconfigured', 'Get-Service failed', $answer['errors']);
}
value('state', text.trim($answer['output']));