From 529da8297b7d70a95787cb277875fc3a0bdbb811 Mon Sep 17 00:00:00 2001 From: Lee Pryor Date: Mon, 1 Feb 2021 12:48:59 +1000 Subject: [PATCH] API doesn't allow null manager_id --- SnipeitPS/Public/New-User.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SnipeitPS/Public/New-User.ps1 b/SnipeitPS/Public/New-User.ps1 index d18e21c..d41177f 100644 --- a/SnipeitPS/Public/New-User.ps1 +++ b/SnipeitPS/Public/New-User.ps1 @@ -107,13 +107,14 @@ function New-User() { company_id = $company_id location_id = $location_id department_id = $department_id - manager_id = $manager_id jobtitle = $jobTitle employee_num = $employee_num notes = "Imported using SnipeitPS Script" activated = 1 } + if ($manager_id) {$Values.manager_id = $manager_id} + if ($ldap_user -eq $false) { $ldap = @{ password = $password