diff --git a/docs/examples/AC_Profile_picture_import.md b/docs/examples/AC_Profile_picture_import.md index c83e8ad..8fa8498 100644 --- a/docs/examples/AC_Profile_picture_import.md +++ b/docs/examples/AC_Profile_picture_import.md @@ -3,11 +3,11 @@ Say you want to bulk import AC profile pictures by dropping them in a folder and naming the image files using a unique identifier. The first the first thing you need to do is authenticate: ```powershell -Connect-Verkada -org_id [your_orgId] -x_api_key (Get-Secret -Name VrkdApiKey -AsPlainText) +Connect-Verkada -x_api_key (Get-Secret -Name VrkdApiKey -AsPlainText) #or for simplicity when not using secrets. -Connect-Verkada -org_id [your_orgId] -x_api_key [your_api_key] +Connect-Verkada -x_api_key [your_api_key] ``` >Then if you've named the image files using the user's **user_id**, like fc6c3648-aa4a-4999-b1a0-a64b81e2cb76.jpg, you can use something like this: @@ -26,7 +26,7 @@ or or ->If you've named the image files using the user's **email**, like some.user@contoso.com.jpg, we will need to find the user_id to set the picture with something like this: +>If you've named the image files using the user's **email**, like `some.user@contoso.com.jpg`, we will need to find the user_id to set the picture with something like this: > >```powershell >Get-ChildItem ~/Documents/AC_profile_pictures | ForEach-Object {$temp = $_; read-VerkadaAccessUsers -version v1 -refresh | Where-Object {$_.email -eq $temp.BaseName} | Set-VerkadaAccessUserProfilePicture -imagePath $temp.FullName; $temp = $null} diff --git a/docs/examples/Merge_duplicate_AC_users.md b/docs/examples/Merge_duplicate_AC_users.md new file mode 100644 index 0000000..e5f15d6 --- /dev/null +++ b/docs/examples/Merge_duplicate_AC_users.md @@ -0,0 +1,110 @@ +# Merge Duplicate AC Users + +Say you want to find duplicate AC users and merge their group membership, cards, and profile pictures. First thing to do is to get an export of the AC users from Command. Then, add a new field to the CSV, **duplicate_userId**. Then we will use that CSV for the import in the script. + +```powershell +Connect-Verkada -x_api_key (Get-Secret -Name VrkdApiKey -AsPlainText) + +#or for simplicity when not using secrets. + +Connect-Verkada -x_api_key [your_api_key] +``` + +After connecting, we will import the user CSV and create our logic for determining duplicate Ids and which user we want to live on. + +```powershell +# import users +$exportedUsers = Import-Csv ~/command-user-export.csv + +# find users with emails that have duplicate users with the same first and last names +# this logic can be changed to meet the needs to determine duplicates +foreach ($user in $exportedUsers){ + if (!([string]::IsNullOrEmpty($user.email))){ + $user.duplicate_userId = $exportedUsers | Where-Object {[string]::IsNullOrEmpty($_.email) -and $_.firstName -ieq $user.firstName -and $_.lastName -ieq $user.lastName} | Select-Object -ExpandProperty userId + } +} +$duplicateSCIMusers = $exportedUsers | Where-Object {!([string]::IsNullOrEmpty($_.duplicate_userId))} +``` + +Once we have the duplicate_userId field added to our CSV the logic below will describe what will be done in the output and perform it in Command. + +```powershell +Start-Transcript -Path ~/transcript_output.txt +$doWork = $false +foreach ($dupe in $duplicateSCIMusers){ + foreach ($dupeId in $dupe.duplicate_userId){ + # determine if duplicate is active + if ($dupe.status -ieq 'active'){ + if (($exportedUsers | Where-Object {$_.userId -eq $dupeId}).status -ieq 'active'){ + write-host "$($dupe.firstName) $($dupe.lastName) - $($dupe.userId) SCIM user is active and has the duplicate account $($dupeId) for us to work on" + $doWork = $true + } else { + write-host "Will do nothing, $($dupe.firstName) $($dupe.lastName) - $($dupe.userId) SCIM user is active but the duplicate account $($dupeId) is $(($exportedUsers | Where-Object {$_.userId -eq $dupeId}).status)." + $doWork = $false + } + } else { + if (($exportedUsers | Where-Object {$_.userId -eq $dupeId}).status -ieq 'active'){ + write-host "$($dupe.firstName) $($dupe.lastName) - $($dupe.userId) SCIM user is $($dupe.status) but the duplicate account $($dupeId) is active, what should we do?" + $doWork = $false + } else { + write-host "Will do nothing, Neither $($dupe.firstName) $($dupe.lastName) - $($dupe.userId) SCIM user or the duplicate account $($dupeId) is active." + $doWork = $false + } + } + + if($doWork){ + # gather all the groups the duplicate is a part of + try { + $groups = Get-VerkadaAccessUser -userId $dupeId -ErrorAction Stop | Select-Object -ExpandProperty access_groups + Write-host "$($dupeId) is part of the following AC Groups: $($groups.name -join ',')" + $scimUserGroups = Get-VerkadaAccessUser -userId $dupe.userId | Select-Object -ExpandProperty access_groups | Select-Object -ExpandProperty group_id + foreach ($group in $groups){ + # determine if the user is already apart of that group + If ($scimUserGroups -contains $group.group_id ){ + Write-Host "$($dupe.firstName) $($dupe.lastName) - $($dupe.userId) is already a part of $($group.name) and doesn't need to be added" + } else { + Write-Host "$($dupe.firstName) $($dupe.lastName) - $($dupe.userId) needs to be added to $($group.name)" + # add user to group if necessary + Set-VerkadaAccessUserGroup -userId $dupe.userId -groupId $group.group_id + } + } + $scimUserGroups = $null + } catch { + $groups = @() + Write-Host "$($dupeId) is not part of any AC groups" + } + + # gather all the cards the duplicate has + $cards = Get-VerkadaAccessUser -userId $dupeId | Select-Object -ExpandProperty cards | Where-Object {$_.active -eq $true} + if ([string]::IsNullOrEmpty($cards)){ + Write-Host "$($dupeId) has no active cards to move" + } else { + Write-host "$($dupeId) has the following cards to move to $($dupe.firstName) $($dupe.lastName) - $($dupe.userId): $($cards.card_number -join ',')" + # assign those cards to the SCIM user + foreach ($card in $cards){ + Add-VerkadaAccessUserCard -userId $dupe.userId -cardType $card.type -cardNumber $card.card_number -facilityCode $card.facility_code -active $true + } + } + + # determine if duplicate has a photo and the SCIM user doesn't + if (!(Get-VerkadaAccessUser -userId $dupe.userId | Select-Object -ExpandProperty has_profile_photo)){ + if (Get-VerkadaAccessUser -userId $dupeId | Select-Object -ExpandProperty has_profile_photo){ + Write-Host "$($dupeId) has a profile photo to copy to $($dupe.firstName) $($dupe.lastName) - $($dupe.userId)" + # get profile photo + Get-VerkadaAccessUserProfilePicture -userId $dupeId -original $true -outPath ~/Downloads/tempPics/ + + # add profile photo to SCIM user + Set-VerkadaAccessUserProfilePicture -userId $dupe.userId -imagePath "~/Downloads/tempPics/$dupeId.jpg" + } + } + # deactivtate the duplicate user + Set-VerkadaAccessUserEndDate -userId $dupeId -endDate (Get-Date) + } + $doWork = $false + + Write-Host "" + } + +} +Stop-Transcript +``` diff --git a/docs/examples/Using_secrets.md b/docs/examples/Using_secrets.md index 44fef27..3b2fd69 100644 --- a/docs/examples/Using_secrets.md +++ b/docs/examples/Using_secrets.md @@ -6,11 +6,11 @@ If you need to retrieve an API key and submit it as plain text. ```powershell $vrkdApiKey = Get-Secret -Name VrkdApiKey -AsPlainText -Connect-Verkada -org_id [your_orgId] -x_api_key $vrkdApiKey +Connect-Verkada -x_api_key $vrkdApiKey #or -Connect-Verkada -org_id [your_orgId] -x_api_key (Get-Secret -Name VrkdApiKey -AsPlainText) +Connect-Verkada -x_api_key (Get-Secret -Name VrkdApiKey -AsPlainText) ``` If you need to retrieve a user password and submit it as a SecureString. diff --git a/docs/function-documentation/Access/Read-VerkadaAccessUsers.md b/docs/function-documentation/Access/Read-VerkadaAccessUsers.md index 8bedc63..f3aecb0 100644 --- a/docs/function-documentation/Access/Read-VerkadaAccessUsers.md +++ b/docs/function-documentation/Access/Read-VerkadaAccessUsers.md @@ -12,6 +12,12 @@ Gathers all Access Users in an organization via the legacy private API or using ## SYNTAX +### v1 (Default) +``` +Read-VerkadaAccessUsers [-x_verkada_auth_api ] [-region ] [-refresh] [-version ] + [-errorsToFile] [-ProgressAction ] [] +``` + ### legacy ``` Read-VerkadaAccessUsers [[-query] ] [[-variables] ] [-region ] @@ -19,12 +25,6 @@ Read-VerkadaAccessUsers [[-query] ] [[-variables] ] [-region ] [-ProgressAction ] [] ``` -### v1 -``` -Read-VerkadaAccessUsers [-x_verkada_auth_api ] [-region ] [-refresh] [-version ] - [-errorsToFile] [-ProgressAction ] [] -``` - ## DESCRIPTION This function will return all the active Access users in an organization. The org_id and reqired tokens can be directly submitted as parameters, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. diff --git a/docs/function-documentation/ConvertFrom-PropertylessJson.md b/docs/function-documentation/ConvertFrom-PropertylessJson.md new file mode 100644 index 0000000..37e1430 --- /dev/null +++ b/docs/function-documentation/ConvertFrom-PropertylessJson.md @@ -0,0 +1,90 @@ +--- +external help file: verkadaModule-help.xml +Module Name: verkadaModule +online version: https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Connect-Verkada.md +schema: 2.0.0 +--- + +# ConvertFrom-PropertylessJson + +## SYNOPSIS +{{ Fill in the Synopsis }} + +## SYNTAX + +``` +ConvertFrom-PropertylessJson [[-Object1] ] [[-keyProperty] ] + [-ProgressAction ] [] +``` + +## DESCRIPTION +{{ Fill in the Description }} + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> {{ Add example code here }} +``` + +{{ Add example description here }} + +## PARAMETERS + +### -Object1 +{{ Fill Object1 Description }} + +```yaml +Type: Object +Parameter Sets: (All) +Aliases: + +Required: False +Position: 0 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -keyProperty +{{ Fill keyProperty Description }} + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### None +## OUTPUTS + +### System.Object +## NOTES + +## RELATED LINKS diff --git a/docs/function-documentation/Get-AddressCheck.md b/docs/function-documentation/Get-AddressCheck.md new file mode 100644 index 0000000..4842786 --- /dev/null +++ b/docs/function-documentation/Get-AddressCheck.md @@ -0,0 +1,87 @@ +--- +external help file: verkadaModule-help.xml +Module Name: verkadaModule +online version: https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Find-VerkadaUserId.md +schema: 2.0.0 +--- + +# Get-AddressCheck + +## SYNOPSIS +Used to verify an address with Google Maps API and retrieve lat/lon + +## SYNTAX + +``` +Get-AddressCheck [-address] [-key ] [-ProgressAction ] [] +``` + +## DESCRIPTION +Private function to verify an address with Google Maps API and retrieve lat/lon + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> {{ Add example code here }} +``` + +{{ Add example description here }} + +## PARAMETERS + +### -address +The url for the enpoint to be used + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -key +Google Maps API Key + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: AIzaSyBOqayI1MPP1zWM_MiP-Hjq3gR9144jqvM +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS diff --git a/docs/function-documentation/Get-HumanReadableSchedule.md b/docs/function-documentation/Get-HumanReadableSchedule.md new file mode 100644 index 0000000..e2ad2fa --- /dev/null +++ b/docs/function-documentation/Get-HumanReadableSchedule.md @@ -0,0 +1,56 @@ +--- +external help file: verkadaModule-help.xml +Module Name: verkadaModule +online version: https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Find-VerkadaUserId.md +schema: 2.0.0 +--- + +# Get-HumanReadableSchedule + +## SYNOPSIS +{{ Fill in the Synopsis }} + +## SYNTAX + +``` +Get-HumanReadableSchedule [[-events] ] +``` + +## DESCRIPTION +{{ Fill in the Description }} + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> {{ Add example code here }} +``` + +{{ Add example description here }} + +## PARAMETERS + +### -events +{{ Fill events Description }} + +```yaml +Type: Object +Parameter Sets: (All) +Aliases: + +Required: False +Position: 0 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +## INPUTS + +### None +## OUTPUTS + +### System.Object +## NOTES + +## RELATED LINKS diff --git a/docs/function-documentation/Invoke-VerkadaCommandCall.md b/docs/function-documentation/Invoke-VerkadaCommandCall.md new file mode 100644 index 0000000..1f4341e --- /dev/null +++ b/docs/function-documentation/Invoke-VerkadaCommandCall.md @@ -0,0 +1,194 @@ +--- +external help file: verkadaModule-help.xml +Module Name: verkadaModule +online version: https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Get-VerkadaWorkplaceEmployee.md +schema: 2.0.0 +--- + +# Invoke-VerkadaCommandCall + +## SYNOPSIS +Used to build an Invoke-RestMethod call for Verkada's private API enpoints + +## SYNTAX + +``` +Invoke-VerkadaCommandCall [-url] [-org_id] [-body] [-method ] + [-contentType ] [-outFile ] -usr -x_verkada_token -x_verkada_auth + [-ProgressAction ] [] +``` + +## DESCRIPTION +Private function to build Invoke-RestMethod calls for Verkada's private API enpoints + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> {{ Add example code here }} +``` + +{{ Add example description here }} + +## PARAMETERS + +### -url +The url for the enpoint to be used + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -org_id +The UUID of the organization the user belongs to + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -body +The body of the REST call + +```yaml +Type: Object +Parameter Sets: (All) +Aliases: + +Required: True +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -method +HTTP method required + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: GET +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -contentType +ContentType + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: Application/json +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -outFile +This is the path output files will attempt to saved to + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -usr +The UUID of the user account making the request + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -x_verkada_token +The Verkada(CSRF) token of the user running the command + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -x_verkada_auth +The Verkada Auth(session auth) token of the user running the command + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS diff --git a/docs/function-documentation/Invoke-VerkadaCommandInit.md b/docs/function-documentation/Invoke-VerkadaCommandInit.md new file mode 100644 index 0000000..c65a2bd --- /dev/null +++ b/docs/function-documentation/Invoke-VerkadaCommandInit.md @@ -0,0 +1,120 @@ +--- +external help file: verkadaModule-help.xml +Module Name: verkadaModule +online version: https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Get-VerkadaWorkplaceEmployee.md +schema: 2.0.0 +--- + +# Invoke-VerkadaCommandInit + +## SYNOPSIS +{{ Fill in the Synopsis }} + +## SYNTAX + +``` +Invoke-VerkadaCommandInit [[-org_id] ] [[-x_verkada_token] ] [[-x_verkada_auth] ] + [[-usr] ] [-ProgressAction ] [] +``` + +## DESCRIPTION +{{ Fill in the Description }} + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> {{ Add example code here }} +``` + +{{ Add example description here }} + +## PARAMETERS + +### -org_id +{{ Fill org_id Description }} + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -usr +{{ Fill usr Description }} + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -x_verkada_auth +{{ Fill x_verkada_auth Description }} + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -x_verkada_token +{{ Fill x_verkada_token Description }} + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String +## OUTPUTS + +### System.Object +## NOTES + +## RELATED LINKS diff --git a/docs/function-documentation/Invoke-VerkadaFormCall.md b/docs/function-documentation/Invoke-VerkadaFormCall.md new file mode 100644 index 0000000..d473c5b --- /dev/null +++ b/docs/function-documentation/Invoke-VerkadaFormCall.md @@ -0,0 +1,186 @@ +--- +external help file: verkadaModule-help.xml +Module Name: verkadaModule +online version: https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Get-VerkadaWorkplaceEmployee.md +schema: 2.0.0 +--- + +# Invoke-VerkadaFormCall + +## SYNOPSIS +Used to build an Invoke-RestMethod call for Verkada's private API enpoints that require a form + +## SYNTAX + +### Default (Default) +``` +Invoke-VerkadaFormCall [-url] [-form_params] [-query_params ] [-method ] + [-x_verkada_auth_api ] [-ProgressAction ] [] +``` + +### UnPwd +``` +Invoke-VerkadaFormCall [-url] [-org_id] [-form_params] [-query_params ] + [-method ] -x_verkada_token -x_verkada_auth [-ProgressAction ] + [] +``` + +## DESCRIPTION +Private function to build Invoke-RestMethod calls for Verkada's private API enpoints that require a form + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> {{ Add example code here }} +``` + +{{ Add example description here }} + +## PARAMETERS + +### -url +The url for the enpoint to be used + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -org_id +The UUID of the organization the user belongs to + +```yaml +Type: String +Parameter Sets: UnPwd +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -form_params +Object to pass form parameters to forms + +```yaml +Type: Object +Parameter Sets: (All) +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -query_params +Object containing the query parameters need that will be put into the query string of the uri + +```yaml +Type: Object +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -method +HTTP method required + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: POST +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -x_verkada_token +The Verkada(CSRF) token of the user running the command + +```yaml +Type: String +Parameter Sets: UnPwd +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -x_verkada_auth +The Verkada Auth(session auth) token of the user running the command + +```yaml +Type: String +Parameter Sets: UnPwd +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -x_verkada_auth_api +The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway + +```yaml +Type: String +Parameter Sets: Default +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS diff --git a/docs/function-documentation/Invoke-VerkadaGraphqlCall.md b/docs/function-documentation/Invoke-VerkadaGraphqlCall.md new file mode 100644 index 0000000..cefc18b --- /dev/null +++ b/docs/function-documentation/Invoke-VerkadaGraphqlCall.md @@ -0,0 +1,247 @@ +--- +external help file: verkadaModule-help.xml +Module Name: verkadaModule +online version: https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Get-VerkadaWorkplaceEmployee.md +schema: 2.0.0 +--- + +# Invoke-VerkadaGraphqlCall + +## SYNOPSIS +Used to build an Invoke-RestMethod call for Verkada's graphql enpoint + +## SYNTAX + +### body +``` +Invoke-VerkadaGraphqlCall [-url] [-body] [-method ] [-page_size ] + -propertyName -org_id -usr -x_verkada_token -x_verkada_auth + [-pagination] [-ProgressAction ] [] +``` + +### query +``` +Invoke-VerkadaGraphqlCall [-url] [-method ] [-page_size ] -propertyName + [-query] [-qlVariables] -org_id -usr -x_verkada_token + -x_verkada_auth [-pagination] [-ProgressAction ] [] +``` + +## DESCRIPTION +Private function to build Invoke-RestMethod calls for Verkada's graphql enpoint + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> {{ Add example code here }} +``` + +{{ Add example description here }} + +## PARAMETERS + +### -url +The url for the enpoint to be used + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -body +The body of the REST call + +```yaml +Type: Object +Parameter Sets: body +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -method +HTTP method required + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: GET +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -page_size +The page size used for pagination + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: 100 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -propertyName +The property to be used from the returned payload + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -query +The graphql query + +```yaml +Type: Object +Parameter Sets: query +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -qlVariables +The graphql variables + +```yaml +Type: Object +Parameter Sets: query +Aliases: + +Required: True +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -org_id +The UUID of the organization the user belongs to + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -usr +The UUID of the user account making the request + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -x_verkada_token +The Verkada(CSRF) token of the user running the command + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -x_verkada_auth +The Verkada Auth(session auth) token of the user running the command + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -pagination +Switch to enable pagination through records + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS diff --git a/docs/function-documentation/Invoke-VerkadaRestMethod.md b/docs/function-documentation/Invoke-VerkadaRestMethod.md new file mode 100644 index 0000000..1295dd3 --- /dev/null +++ b/docs/function-documentation/Invoke-VerkadaRestMethod.md @@ -0,0 +1,269 @@ +--- +external help file: verkadaModule-help.xml +Module Name: verkadaModule +online version: https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Get-VerkadaWorkplaceEmployee.md +schema: 2.0.0 +--- + +# Invoke-VerkadaRestMethod + +## SYNOPSIS +Used to build an Invoke-RestMethod call for Verkada's private API enpoints + +## SYNTAX + +### Default (Default) +``` +Invoke-VerkadaRestMethod [-url] [-x_verkada_auth_api] [[-query_params] ] + [[-body_params] ] [-method ] [-outFile ] [-ProgressAction ] + [] +``` + +### UnPwd +``` +Invoke-VerkadaRestMethod [-url] [-org_id] [[-body_params] ] [-method ] + -x_verkada_token -x_verkada_auth [-UnPwd] [-outFile ] + [-ProgressAction ] [] +``` + +### Pagination +``` +Invoke-VerkadaRestMethod [-url] [-x_verkada_auth_api] [[-query_params] ] + [[-body_params] ] [-method ] [-pagination] -page_size -propertyName + [-outFile ] [-ProgressAction ] [] +``` + +## DESCRIPTION +Private function to build Invoke-RestMethod calls for Verkada's private API enpoints + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> {{ Add example code here }} +``` + +{{ Add example description here }} + +## PARAMETERS + +### -url +The url for the enpoint to be used + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -org_id +The UUID of the organization the user belongs to + +```yaml +Type: String +Parameter Sets: UnPwd +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -x_verkada_auth_api +The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway + +```yaml +Type: String +Parameter Sets: Default, Pagination +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -query_params +Object containing the query parameters need that will be put into the query string of the uri + +```yaml +Type: Object +Parameter Sets: Default, Pagination +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -body_params +The body of the REST call + +```yaml +Type: Object +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -method +HTTP method required + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: GET +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -pagination +Switch to enable pagination through records + +```yaml +Type: SwitchParameter +Parameter Sets: Pagination +Aliases: + +Required: True +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -page_size +The page size used for pagination + +```yaml +Type: String +Parameter Sets: Pagination +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -propertyName +The property to be used from the returned payload + +```yaml +Type: String +Parameter Sets: Pagination +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -x_verkada_token +The Verkada(CSRF) token of the user running the command + +```yaml +Type: String +Parameter Sets: UnPwd +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -x_verkada_auth +The Verkada Auth(session auth) token of the user running the command + +```yaml +Type: String +Parameter Sets: UnPwd +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -UnPwd +Switch to indicate username/password auth is required + +```yaml +Type: SwitchParameter +Parameter Sets: UnPwd +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -outFile +This is the path output files will attempt to saved to + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS diff --git a/docs/function-documentation/Merge-Objects.md b/docs/function-documentation/Merge-Objects.md new file mode 100644 index 0000000..ccd9f94 --- /dev/null +++ b/docs/function-documentation/Merge-Objects.md @@ -0,0 +1,90 @@ +--- +external help file: verkadaModule-help.xml +Module Name: verkadaModule +online version: https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Get-VerkadaWorkplaceEmployee.md +schema: 2.0.0 +--- + +# Merge-Objects + +## SYNOPSIS +{{ Fill in the Synopsis }} + +## SYNTAX + +``` +Merge-Objects [[-Object1] ] [[-Object2] ] [-ProgressAction ] + [] +``` + +## DESCRIPTION +{{ Fill in the Description }} + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> {{ Add example code here }} +``` + +{{ Add example description here }} + +## PARAMETERS + +### -Object1 +{{ Fill Object1 Description }} + +```yaml +Type: Object +Parameter Sets: (All) +Aliases: + +Required: False +Position: 0 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Object2 +{{ Fill Object2 Description }} + +```yaml +Type: Object +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### None +## OUTPUTS + +### System.Object +## NOTES + +## RELATED LINKS diff --git a/docs/function-documentation/New-WebSession.md b/docs/function-documentation/New-WebSession.md new file mode 100644 index 0000000..baf583f --- /dev/null +++ b/docs/function-documentation/New-WebSession.md @@ -0,0 +1,71 @@ +--- +external help file: verkadaModule-help.xml +Module Name: verkadaModule +online version: https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Get-VerkadaWorkplaceEmployee.md +schema: 2.0.0 +--- + +# New-WebSession + +## SYNOPSIS +{{ Fill in the Synopsis }} + +## SYNTAX + +``` +New-WebSession [[-Cookies] ] [[-For] ] +``` + +## DESCRIPTION +{{ Fill in the Description }} + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> {{ Add example code here }} +``` + +{{ Add example description here }} + +## PARAMETERS + +### -Cookies +{{ Fill Cookies Description }} + +```yaml +Type: Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: 0 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -For +{{ Fill For Description }} + +```yaml +Type: Uri +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +## INPUTS + +### None +## OUTPUTS + +### System.Object +## NOTES + +## RELATED LINKS diff --git a/verkadaModule/Public/Access/Read-VerkadaAccessUsers.ps1 b/verkadaModule/Public/Access/Read-VerkadaAccessUsers.ps1 index b6f9940..5f80149 100644 --- a/verkadaModule/Public/Access/Read-VerkadaAccessUsers.ps1 +++ b/verkadaModule/Public/Access/Read-VerkadaAccessUsers.ps1 @@ -26,7 +26,7 @@ function Read-VerkadaAccessUsers{ Read-VerkadaAccessUsers -version v1 -refresh This will return all the active access users in an organization with the most recent data available from the Command v1 public API endpoint. The token will be populated from the cache created by Connect-Verkada. #> - [CmdletBinding(PositionalBinding = $true)] + [CmdletBinding(PositionalBinding = $true, DefaultParameterSetName = 'v1')] param ( #This is the graphql query to be submitted (do not use unless you know what you are doing) [Parameter(Position = 1, ParameterSetName = 'legacy')] diff --git a/verkadaModule/verkadaModule.psd1 b/verkadaModule/verkadaModule.psd1 index 571608f..8919f4f 100644 --- a/verkadaModule/verkadaModule.psd1 +++ b/verkadaModule/verkadaModule.psd1 @@ -3,7 +3,7 @@ # # Generated by: Verkada SE Community # -# Generated on: 11/13/2025 +# Generated on: 12/10/2025 # @{ @@ -12,7 +12,7 @@ RootModule = 'verkadaModule.psm1' # Version number of this module. -ModuleVersion = '0.10.1' +ModuleVersion = '0.10.2' # Supported PSEditions CompatiblePSEditions = 'Desktop', 'Core'