Skip to content

Commit

Permalink
Added check for Ninja fields
Browse files Browse the repository at this point in the history
  • Loading branch information
jayrodksmith authored Mar 21, 2024
1 parent fb73918 commit 228da72
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion Private/RMM/Get-WarrantyNinjaRMM.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,27 @@ function Get-WarrantyNinjaRMM {
[Parameter(Mandatory = $false)]
[Switch]$Display
)

# Test if fields exist
$testninjawarrantystart = Ninja-Property-Get $ninjawarrantystart 2>&1
if ($testninjawarrantystart -match "Unable to find the specified field" ){
Write-Host "Unable to access warrantystart field in ninja"
Write-Host "Check permissions of field and that it exists"
}
$testninjawarrantystatus = Ninja-Property-Get $ninjawarrantystatus 2>&1
if ($testninjawarrantystatus -match "Unable to find the specified field" ){
Write-Host "Unable to access warrantystatus field in ninja"
Write-Host "Check permissions of field and that it exists"
}
$testninjawarrantyexpiry = Ninja-Property-Get $ninjawarrantyexpiry 2>&1
if ($testninjawarrantyexpiry -match "Unable to find the specified field" ){
Write-Host "Unable to access warrantyexpiry field in ninja"
Write-Host "Check permissions of field and that it exists"
}
$testninjainvoicenumber = Ninja-Property-Get $ninjainvoicenumber 2>&1
if ($testninjainvoicenumber -match "Unable to find the specified field" ){
Write-Host "Unable to access invoicenumber field in ninja"
Write-Host "Check permissions of field and that it exists"
}
$ninjawarrantystartvalue = Ninja-Property-Get $ninjawarrantystart
$ninjawarrantystatusvalue = Ninja-Property-Get $ninjawarrantystatus
$ninjawarrantyexpiryvalue = Ninja-Property-Get $ninjawarrantyexpiry
Expand Down

0 comments on commit 228da72

Please sign in to comment.