Untitled

mail@pastecode.io avatar
unknown
powershell
a year ago
358 B
3
Indexable
# Function to ping Hostname
Function Ping-Device {

    $devicePing = Test-Connection RX281189 -Quiet

    return $devicePing

}

# Get returned value (On / Off)
$deviceOn = Ping-Device

if ( $deviceOn )
{

    Write-Output "Device is on"

    # MOVE TO NEXT STEP

} else {

    Write-Output "Device is off"
    
    # MOVE TO END

}