From 581e469b1c3f4b919ae21203dd5fdf027e56d211 Mon Sep 17 00:00:00 2001 From: mattcobb0404 <113397635+mattcobb0404@users.noreply.github.com> Date: Wed, 7 Feb 2024 11:16:28 -0600 Subject: [PATCH] Update DeployTheNCAgent.ps1 Correctly handled null or white space in $RetrievedRegistrationToken --- DeployTheNCAgent/DeployTheNCAgent.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DeployTheNCAgent/DeployTheNCAgent.ps1 b/DeployTheNCAgent/DeployTheNCAgent.ps1 index d494b8d..6b13e00 100644 --- a/DeployTheNCAgent/DeployTheNCAgent.ps1 +++ b/DeployTheNCAgent/DeployTheNCAgent.ps1 @@ -54,7 +54,7 @@ While ($rowid -lt $CustomerList.Count -and $found -eq $False) If($rowitem.key -eq "customer.registrationtoken") { $RetrievedRegistrationToken = $rowitem.value - If($RetrievedRegistrationToken -eq "") + If([string]::IsNullOrWhitespace($RetrievedRegistrationToken)) { "Note that a valid Registration Token was not returned even though the customer was found. This happens when an agent install has never been downloaded for that customer. Try to download an agent from the N-Central UI and run this script again" }