SnipeitPS icon indicating copy to clipboard operation
SnipeitPS copied to clipboard

New-SnipeitUser -deleted param

Open loganhawker opened this issue 3 years ago • 0 comments

Context

Trying to pull deleted users to restore any staff that have returned so asset history is maintained.

Your Environment

  • SnipitPS Module version used: 1.10.227
  • Operating System and PowerShell version: 5.1.19041.2364
  • Snipe It version: v6.0.14

Expected Behavior

Calling Get-SnipeitUser -all -deleted $true returns deleted users. It looks like $true is being passed as a parameter to the API but it should be 'true' as a string. The parameter validates for boolean $true/$false or 0/1 so I can't pass -deleted 'true'

Current Behavior

Returns same as Get-SnipeitUser -all, seems like -deleted is ignored.

Possible Solution

Could probably just switch the variables to strings before the request is made. $deleted = switch ($deleted) { $true {'true'} $false {'false'} }

Steps to Reproduce (for bugs)

  1. Get-SnipeitUser -all -deleted $true

loganhawker avatar Mar 27 '23 21:03 loganhawker