Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New-SnipeitUser -deleted param #298

Open
loganhawker opened this issue Mar 27, 2023 · 0 comments
Open

New-SnipeitUser -deleted param #298

loganhawker opened this issue Mar 27, 2023 · 0 comments

Comments

@loganhawker
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant