Public/Start-SwNodePoll.ps1
Function Start-SwNodePoll { <# .SYNOPSIS Trigger Poll now for target. .DESCRIPTION by using this function you can trigger polling Now for a target to update node data in database. Note: Node Id of target machine is required, you can execute "Get-Node" command to find node Id. #> [CmdletBinding(SupportsShouldProcess=$true,ConfirmImpact='None')] Param ( [Parameter(Mandatory = $true)] [SolarWinds.InformationService.Contract2.InfoServiceProxy]$InfoServiceProxy, [Parameter(Mandatory = $true)] [int]$NodeId ) Begin{ $id = $NodeId.ToString() } Process{ if($PSCmdlet.ShouldProcess( "Verbose Description !", "Start Polling" + "Caption")){ Write-Verbose -Message "Sending command to server ... " Invoke-SwisVerb -SwisConnection $InfoServiceProxy -EntityName "Orion.Nodes" -Verb "PollNow" -Arguments @("N:$id") | Out-Null } } End{ } } |