Jump to content
View in the app

A better way to browse. Learn more.

Pulseway

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Trying to get a custom script to obtain system uptime in hours and if uptime is greater than 24 hours send a console message to logged in user.  Here is what I have so far, but the $Final variable will not populate properly.  Also would like to pass the final uptime to an output variable which is tied to a custom field (system level) for use in workflows. 

Quote

# Outputs
$HoursUp = 0
$Final = 0
function Get-Uptime {
   $os = Get-WmiObject win32_operatingsystem
   $uptime = (Get-Date) - ($os.ConvertToDateTime($os.lastbootuptime))
   $Display = "Display Uptime: " + $uptime.TotalHours + " hours"
   $Final = $uptime.TotalHours
   Write-Output $Display
}

function NotifyLocalConsole {
msg console /server:localhost ("This System has not been restarted for " + $Final + "hours.  Please Restart this machine when possible.")
}

Get-Uptime

NotifyLocalConsole
if ($Final > 24) {NotifyLocalConsole}
$HoursUp = $Uptime.TotalHours

Any help would be greatly appreciated

  • Administrators

Please don't forget to inform Pulseway of the new $Final value using the following line:

Start-Process -FilePath "$env:PWY_HOME\CLI.exe" -ArgumentList ("setVariable Final $Final") -Wait

-Paul

  • 2 weeks later...

@Paul Can you explain more about how to fill custom fields i've send you a DM.

Cannot find any documentation that we can use.

Thanks!

Create an account or sign in to comment

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.