Skip to content

Commit

Permalink
Combine PowerShell Functions into 1 script for RMM
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Mar 21, 2024
1 parent 08509fe commit 788b981
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion EasyWarrantyCheck_RMM.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1742,6 +1742,18 @@ function Write-WarrantyNinjaRMM {
Write-Verbose "WarrantyExpiry UTC: $WarrantyExpiryutc"
}
Write-Verbose "Checking for warranty values to write to NinjaRMM"
$NinjaWarrantyObj = [PSCustomObject]@{
'Ninja Warranty Start' = $ninjawarrantystart
'Ninja Warranty Expiry' = $ninjawarrantyexpiry
'Ninja Warranty Status' = $ninjawarrantystatus
'Ninja Invoicenumber' = $ninjainvoicenumber
'Ninja Device Age' = $ninjadeviceage
}
if ($VerbosePreference -eq 'Continue') {
Write-Verbose "NinjaRMM Custom Field Values"
$NinjaWarrantyObj
}

if($Warrantystartutc){
Write-Verbose "Will try write Warranty Start Value : $Warrantystartutc"
Ninja-Property-Set $ninjawarrantystart $Warrantystartutc
Expand All @@ -1766,7 +1778,7 @@ function Write-WarrantyNinjaRMM {
if ($calculatedageofdevice -ne $false){
$Currentdeviceage = Ninja-Property-Get $ninjadeviceage
if($Currentdeviceage -ne $calculatedageofdevice){
Write-Verbose "Will try write Warranty Expiry Value : $calculatedageofdevice"
Write-Verbose "Will try write Device Age Value : $calculatedageofdevice"
Ninja-Property-Set $ninjadeviceage $calculatedageofdevice
}
}
Expand Down

0 comments on commit 788b981

Please sign in to comment.