You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I needed to leverage the Get-HuduUsers and it wasn't showing as available in the API even though it's in the Public folder in GitHub. I suspect it just wasn't marked as such in the manifest.
I've also updated it slightly to include clearer synopsis and the ability to leverage the archived parameter. It is pulling correct data. Below is the module if you care to use it.
function Get-HuduUsers {
<#
.SYNOPSIS
Get a list of Users
.DESCRIPTION
Call Hudu API to retrieve Users
.PARAMETER Id
Id of requested users
.PARAMETER Email
Email address of requested users
.PARAMETER First_name
First Name of the requested user
.PARAMETER Last_name
Last Name of the requested user
.PARAMETER CompanyId
Id of the requested User's company
.PARAMETER Portal_Member_Company_Id
Company Id of portal member's company
.PARAMETER Slug
Filter by slug of user
.PARAMETER Archived
Filter by archived status
.EXAMPLE
Get-HuduUsers -Name 'Jim'
#>
[CmdletBinding()]
Param (
[ValidateRange(1, [int]::MaxValue)]
[Int]$Id = '',
[string]$Email = '',
[string]$First_name = '',
[string]$Last_name = '',
[ValidateRange(1, [int]::MaxValue)]
[Int]$Portal_member_company_id = '',
[String]$Securitylevel = '',
[string]$Slug = '',
[bool]$archived = $false
)
if ($Id) {
Invoke-HuduRequest -Method get -Resource "/api/v1/users/$Id"
} else {
$Params = @{}
if ($Email) { $Params.email = $Email}
if ($First_name) { $Params.first_name = $First_name}
if ($Last_name) { $Params.last_name = $Last_name}
if ($Portal_member_company_id) {$Params.Portal_member_company_id = $Portal_member_company_id}
if ($Securitylevel) {$Params.Securitylevel = $Securitylevel}
if ($Slug) {$Params.slug = $Slug}
if ($archived) {$Params.archived = $archived}
$HuduRequest = @{
Method = 'GET'
Resource = '/api/v1/users'
Params = $Params
}
Invoke-HuduRequestPaginated -HuduRequest $HuduRequest -Property Users
}
}
The text was updated successfully, but these errors were encountered:
Hi, I needed to leverage the Get-HuduUsers and it wasn't showing as available in the API even though it's in the Public folder in GitHub. I suspect it just wasn't marked as such in the manifest.
I've also updated it slightly to include clearer synopsis and the ability to leverage the archived parameter. It is pulling correct data. Below is the module if you care to use it.
The text was updated successfully, but these errors were encountered: