RichardR
Goreloโ€ข5h agoโ€ข
4 replies
Richard

The term 'GoreloAction' is not recognized when running script.

๐ŸฆGorelo Question๐ŸจMSP Question
I'm trying to run a script that passes a value to $gorelo:asset.machine-uptime but I get the above error message.

Any suggestions how to fix?

The script is:

$uptime = (Get-Date) - (Get-CimInstance Win32_OperatingSystem).LastBootUpTime

if ($uptime.Days -gt 14) {
Write-Output "Uptime is $($uptime.Days) days. Rebooting now."
Restart-Computer -Force
} else {
Write-Output "Uptime is $($uptime.Days) days. No reboot needed."
}

GoreloAction -SetCustomField -Name 'asset.machine-uptime' -Value $uptime.Days
Was this page helpful?