Closed leeberg closed 4 years ago
# Ping Check # First Let's define a list of servers to monitor $MonitoredServersSetup = @() $MonitoredServers = @() $Servers = @("www.google.com", "www.github.com", "8.8.8.8","192.168.0.1") # Create some powershell objects to feed into our UI / Update Later $Servers | ForEach-Object{ $ServerObject = [PSCustomObject]@{ Name = $_ Server = $_ #LastUp = (Get-Date) Status = $false } $MonitoredServersSetup += $ServerObject } $MonitoredServers = $MonitoredServersSetup # New Endpoint to ping the server address of my "MonitoredServers Object - we'll also refresh the UD grid." $MonitoredServers | ForEach-Object{ $pingResult = Test-NetConnection $_.Server if($pingResult.PingSucceeded -eq $true) { $_.Status = $true #$_.LastUp = (Get-Date) } else { $_.Status = $false } # OUtput the Custom Object Write-Output $_ } # OUtput a "reglar" powershell object Write-Output (Get-Service | Get-Random)
Here is the job output:
Here is the pipeline output
I get different results by including a "Name" property in my CustomObject
@adamdriscoll working well in latest - anything you wanted to spruce up on this? otherwise I'd say we close it up.
Describe the Issue
Here is the job output:
Here is the pipeline output
Note
I get different results by including a "Name" property in my CustomObject