Skip to content

New-SnipeitUser -deleted param #298

@loganhawker

Description

@loganhawker

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions