From 38dd9f06e0a7ce6a5888a1b7a756986275d27367 Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Thu, 23 Oct 2025 16:18:13 -0500 Subject: [PATCH 1/3] Removes org_id parameter requirement. Removes the org_id parameter requirement from multiple functions in the verkadaModule. This simplifies usage and aligns with intended workflow using Connect-Verkada. Also modifies ParameterSets to Invoke-VerkadaFormCall and Invoke-VerkadaRestMethod functions. closes #282 --- .../Private/Invoke-VerkadaFormCall.ps1 | 5 +-- .../Private/Invoke-VerkadaRestMethod.ps1 | 22 ++++++------ .../Public/Add-VerkadaAccessGroup.ps1 | 16 +++------ .../Public/Add-VerkadaAccessUserCard.ps1 | 18 ++++------ .../Add-VerkadaAccessUserLicensePlate.ps1 | 16 +++------ .../Public/Add-VerkadaAccessUserMfaCode.ps1 | 16 +++------ .../Public/Add-VerkadaCommandUser.ps1 | 24 +++++-------- .../Public/Add-VerkadaHelixEvent.ps1 | 16 +++------ .../Add-VerkadaLicensePlateOfInterest.ps1 | 21 +++++------- verkadaModule/Public/Connect-Verkada.ps1 | 34 ++++++++++--------- .../Public/Disable-VerkadaAccessUserCard.ps1 | 16 +++------ .../Disable-VerkadaAccessUserLicensePlate.ps1 | 16 +++------ verkadaModule/Public/Disconnect-Verkada.ps1 | 5 +-- .../Public/Enable-VerkadaAccessUserCard.ps1 | 16 +++------ .../Enable-VerkadaAccessUserLicensePlate.ps1 | 16 +++------ .../Public/Find-VerkadaHelixEvent.ps1 | 16 +++------ .../Public/Get-VerkadaAccessEvents.ps1 | 16 +++------ .../Public/Get-VerkadaAccessGroup.ps1 | 18 ++++------ .../Public/Get-VerkadaAccessUser.ps1 | 16 +++------ .../Get-VerkadaAccessUserProfilePicture.ps1 | 20 ++++------- verkadaModule/Public/Get-VerkadaCameras.ps1 | 20 ++++------- .../Public/Get-VerkadaCloudBackupSettings.ps1 | 21 +++++------- .../Public/Get-VerkadaCommandUser.ps1 | 16 +++------ .../Public/Get-VerkadaHelixEvent.ps1 | 16 +++------ .../Get-VerkadaLicensePlatesOfInterest.ps1 | 23 ++++++------- .../Public/Read-VerkadaAccessGroups.ps1 | 16 +++------ .../Public/Read-VerkadaAccessUsers.ps1 | 20 ++++------- .../Public/Read-VerkadaGuestSites.ps1 | 14 +++----- .../Public/Remove-VerkadaAccessGroup.ps1 | 16 +++------ .../Remove-VerkadaAccessUserBleUnlock.ps1 | 16 +++------ .../Public/Remove-VerkadaAccessUserCard.ps1 | 16 +++------ .../Remove-VerkadaAccessUserEntryCode.ps1 | 16 +++------ .../Remove-VerkadaAccessUserFromGroup.ps1 | 16 +++------ .../Remove-VerkadaAccessUserLicensePlate.ps1 | 16 +++------ .../Remove-VerkadaAccessUserMfaCode.ps1 | 16 +++------ ...Remove-VerkadaAccessUserProfilePicture.ps1 | 16 +++------ .../Remove-VerkadaAccessUserRemoteUnlock.ps1 | 16 +++------ .../Public/Remove-VerkadaCommandUser.ps1 | 16 +++------ .../Public/Remove-VerkadaHelixEvent.ps1 | 16 +++------ .../Remove-VerkadaLicensePlateOfInterest.ps1 | 20 ++++------- .../Public/Send-VerkadaPassInvite.ps1 | 22 +++++------- .../Public/Set-VerkadaAccessUserBleUnlock.ps1 | 22 +++++------- .../Public/Set-VerkadaAccessUserEndDate.ps1 | 16 +++------ .../Public/Set-VerkadaAccessUserEntryCode.ps1 | 14 +++----- .../Public/Set-VerkadaAccessUserGroup.ps1 | 20 ++++------- .../Set-VerkadaAccessUserProfilePicture.ps1 | 16 +++------ .../Set-VerkadaAccessUserRemoteUnlock.ps1 | 16 +++------ .../Public/Set-VerkadaAccessUserStartDate.ps1 | 16 +++------ .../Public/Set-VerkadaCloudBackupSettings.ps1 | 17 +++------- .../Public/Set-VerkadaCommandUser.ps1 | 22 +++++------- .../Public/Set-VerkadaHelixEvent.ps1 | 16 +++------ .../Set-VerkadaLicensePlateOfInterest.ps1 | 20 ++++------- 52 files changed, 310 insertions(+), 592 deletions(-) diff --git a/verkadaModule/Private/Invoke-VerkadaFormCall.ps1 b/verkadaModule/Private/Invoke-VerkadaFormCall.ps1 index 6a240d0..5e5d8e3 100644 --- a/verkadaModule/Private/Invoke-VerkadaFormCall.ps1 +++ b/verkadaModule/Private/Invoke-VerkadaFormCall.ps1 @@ -13,12 +13,13 @@ function Invoke-VerkadaFormCall [Parameter(Mandatory = $true, Position = 0)] [String]$url, #The UUID of the organization the user belongs to - [Parameter(Mandatory = $true, Position = 1)] + [Parameter(Mandatory = $true, ParameterSetName = 'UnPwd', Position = 1)] [ValidateNotNullOrEmpty()] [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] [String]$org_id, #Object to pass form parameters to forms - [Parameter(Mandatory = $true,Position = 2)] + [Parameter(Mandatory = $true, ParameterSetName = 'Default', Position = 1)] + [Parameter(Mandatory = $true, ParameterSetName = 'UnPwd',Position = 2)] [Object]$form_params, #Object containing the query parameters need that will be put into the query string of the uri [Parameter()] diff --git a/verkadaModule/Private/Invoke-VerkadaRestMethod.ps1 b/verkadaModule/Private/Invoke-VerkadaRestMethod.ps1 index 74974ad..2e2fc7b 100644 --- a/verkadaModule/Private/Invoke-VerkadaRestMethod.ps1 +++ b/verkadaModule/Private/Invoke-VerkadaRestMethod.ps1 @@ -20,23 +20,21 @@ function Invoke-VerkadaRestMethod [Parameter(Mandatory = $true, Position = 0, ParameterSetName = 'UnPwd')] [String]$url, #The UUID of the organization the user belongs to - [Parameter(Mandatory = $true, Position = 1, ParameterSetName = 'Default')] - [Parameter(Mandatory = $true, Position = 1, ParameterSetName = 'Pagination')] [Parameter(Mandatory = $true, Position = 1, ParameterSetName = 'UnPwd')] [ValidateNotNullOrEmpty()] [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] [String]$org_id, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway - [Parameter(Mandatory = $true, Position = 2, ParameterSetName = 'Default')] - [Parameter(Mandatory = $true, Position = 2, ParameterSetName = 'Pagination')] + [Parameter(Mandatory = $true, Position = 1, ParameterSetName = 'Default')] + [Parameter(Mandatory = $true, Position = 1, ParameterSetName = 'Pagination')] [String]$x_verkada_auth_api, #Object containing the query parameters need that will be put into the query string of the uri - [Parameter(Position = 3, ParameterSetName = 'Default')] - [Parameter(Position = 3, ParameterSetName = 'Pagination')] + [Parameter(Position = 2, ParameterSetName = 'Default')] + [Parameter(Position = 2, ParameterSetName = 'Pagination')] [Object]$query_params, #The body of the REST call - [Parameter(Position = 4, ParameterSetName = 'Default')] - [Parameter(Position = 4, ParameterSetName = 'Pagination')] + [Parameter(Position = 3, ParameterSetName = 'Default')] + [Parameter(Position = 3, ParameterSetName = 'Pagination')] [Parameter(Position = 2, ParameterSetName = 'UnPwd')] [Object]$body_params, #HTTP method required @@ -71,7 +69,9 @@ function Invoke-VerkadaRestMethod Process { $query = [System.Web.HttpUtility]::ParseQueryString([String]::Empty) - $query.add('org_id',$org_id) + if ($PSCmdlet.ParameterSetName -eq 'UnPwd'){ + $query.add('org_id',$org_id) + } if($query_params){ foreach ($qp in $query_params.GetEnumerator()) {$query.add("$($qp.name)", "$($qp.value)")} } @@ -147,7 +147,7 @@ function Invoke-VerkadaRestMethod throw [VerkadaRestMethodException] "$res" } else { - Connect-Verkada -x_api_key $Global:verkadaConnection.x_api_key -org_id $Global:verkadaConnection.org_id -region $Global:verkadaConnection.region -noOutput + Connect-Verkada -x_api_key $Global:verkadaConnection.x_api_key -region $Global:verkadaConnection.region -noOutput $headers.'x-verkada-auth' = $Global:verkadaConnection.x_verkada_auth_api } } @@ -220,7 +220,7 @@ function Invoke-VerkadaRestMethod throw [VerkadaRestMethodException] "$res" } else { - Connect-Verkada -x_api_key $Global:verkadaConnection.x_api_key -org_id $Global:verkadaConnection.org_id -region $Global:verkadaConnection.region -noOutput + Connect-Verkada -x_api_key $Global:verkadaConnection.x_api_key -region $Global:verkadaConnection.region -noOutput $headers.'x-verkada-auth' = $Global:verkadaConnection.x_verkada_auth_api } } diff --git a/verkadaModule/Public/Add-VerkadaAccessGroup.ps1 b/verkadaModule/Public/Add-VerkadaAccessGroup.ps1 index e960cf2..ec2d3cd 100644 --- a/verkadaModule/Public/Add-VerkadaAccessGroup.ps1 +++ b/verkadaModule/Public/Add-VerkadaAccessGroup.ps1 @@ -5,18 +5,18 @@ function Add-VerkadaAccessGroup{ .DESCRIPTION Create an access group within the given organization using the given name. The name of the access group must be unique within the organization. This returns the Access Group Metadata Object for the created Access Group. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Add-VerkadaAccessGroup.md .EXAMPLE Add-VerkadaAccessGroup -name 'Newgroup' - This will add the access group with the name "NewGroup". The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will add the access group with the name "NewGroup". The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Add-VerkadaAccessGroup -name 'NewGroup' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This will add the access group with the name "NewGroup". The org_id and tokens are submitted as parameters in the call. + Add-VerkadaAccessGroup -name 'NewGroup' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + This will add the access group with the name "NewGroup". The token is submitted as a parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Add-VrkdaAcGrp","a-VrkdaAcGrp")] @@ -25,11 +25,6 @@ function Add-VerkadaAccessGroup{ [Parameter(ValueFromPipelineByPropertyName = $true)] [Alias('group_name','groupName')] [String]$name, - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway [Parameter()] [ValidateNotNullOrEmpty()] @@ -46,7 +41,6 @@ function Add-VerkadaAccessGroup{ begin { $url = "https://$($region).verkada.com/access/v1/access_groups/group" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -64,7 +58,7 @@ function Add-VerkadaAccessGroup{ $query_params = @{} try { - $response = Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method POST + $response = Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method POST return $response } catch [Microsoft.PowerShell.Commands.HttpResponseException] { diff --git a/verkadaModule/Public/Add-VerkadaAccessUserCard.ps1 b/verkadaModule/Public/Add-VerkadaAccessUserCard.ps1 index a8b02b6..9506ee2 100644 --- a/verkadaModule/Public/Add-VerkadaAccessUserCard.ps1 +++ b/verkadaModule/Public/Add-VerkadaAccessUserCard.ps1 @@ -6,22 +6,22 @@ function Add-VerkadaAccessUserCard{ .DESCRIPTION Create and add an access card for a specified user_id or external_id and org_id. Card object will be passed in the body of the request as a json. We require facility code and card number OR card_number_hex OR card_number_base36. The successful repsonse will be the created credential information. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Add-VerkadaAccessUserCard.md .EXAMPLE Add-VerkadaAccessUserCard -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -type 'HID' -facilityCode 111 -cardNumber 55555 - This will add a badge in the HID format with facility code 111 and card number 55555 to the user specified. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will add a badge in the HID format with facility code 111 and card number 55555 to the user specified. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Add-VerkadaAccessUserCard -externalId 'newUserUPN@contoso.com' -type 'HID' -facilityCode 111 -cardNumber 55555 -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This will add an Access credential in the HID format with facility code 111 and card number 55555 to the user specified. The org_id and tokens are submitted as parameters in the call. + Add-VerkadaAccessUserCard -externalId 'newUserUPN@contoso.com' -type 'HID' -facilityCode 111 -cardNumber 55555 -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + This will add an Access credential in the HID format with facility code 111 and card number 55555 to the user specified. The token is submitted as a parameter in the call. .EXAMPLE Import-Csv ./myUserBadges.csv | Add-VerkadaAccessUserCard - This will add an Access credential for every row in the csv file which contains userId, type, cardNumber(or cardNumberHex or cardNumberBase36), and facilityCode(optional). The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will add an Access credential for every row in the csv file which contains userId, type, cardNumber(or cardNumberHex or cardNumberBase36), and facilityCode(optional). The token will be populated from the cache created by Connect-Verkada. #> [CmdletBinding(PositionalBinding = $true, DefaultParameterSetName = 'cardNumber')] [Alias("Add-VrkdaAcUsrCrd","a-VrkdaAcUsrCrd")] @@ -60,11 +60,6 @@ function Add-VerkadaAccessUserCard{ #Bool value specifying if the credential is currently active. Default value is False. [Parameter(ValueFromPipelineByPropertyName = $true)] [bool]$active=$true, - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway [Parameter()] [ValidateNotNullOrEmpty()] @@ -81,7 +76,6 @@ function Add-VerkadaAccessUserCard{ begin { $url = "https://$($region).verkada.com/access/v1/credentials/card" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -113,7 +107,7 @@ function Add-VerkadaAccessUserCard{ } try { - $response = Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method POST + $response = Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method POST return $response } catch [Microsoft.PowerShell.Commands.HttpResponseException] { diff --git a/verkadaModule/Public/Add-VerkadaAccessUserLicensePlate.ps1 b/verkadaModule/Public/Add-VerkadaAccessUserLicensePlate.ps1 index 6b083c8..ed8f68c 100644 --- a/verkadaModule/Public/Add-VerkadaAccessUserLicensePlate.ps1 +++ b/verkadaModule/Public/Add-VerkadaAccessUserLicensePlate.ps1 @@ -6,18 +6,18 @@ function Add-VerkadaAccessUserLicensePlate{ .DESCRIPTION Add a license plate credential to a user given a specified user_id or external_id and org_id. License plate object will be passed in the body of the request as a json. We require a string of 6 alphanumeric values. The License Plate Object is returned. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Add-VerkadaAccessUserLicensePlate.md .EXAMPLE Add-VerkadaAccessUserLicensePlate -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -licensePlateNumber 'ABC123' - This will add the license plate ABC123 to the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 as a credential. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will add the license plate ABC123 to the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 as a credential. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Add-VerkadaAccessUserLicensePlate -externalId 'newUserUPN@contoso.com' -licensePlateNumber 'ABC123' -name 'Users License Plate' -active $true -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_token 'a366ef47-2c20-4d35-a90a-10fd2aee113a' - This will add the license plate ABC123 to the Access user with externalId newUserUPN@contoso.com as a credential and mark it active. The org_id and tokens are submitted as parameters in the call. + Add-VerkadaAccessUserLicensePlate -externalId 'newUserUPN@contoso.com' -licensePlateNumber 'ABC123' -name 'Users License Plate' -active $true -x_verkada_token 'a366ef47-2c20-4d35-a90a-10fd2aee113a' + This will add the license plate ABC123 to the Access user with externalId newUserUPN@contoso.com as a credential and mark it active. The token is submitted as a parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Add-VrkdaAcUsrLPR","a-VrkdaAcUsrLPR")] @@ -43,11 +43,6 @@ function Add-VerkadaAccessUserLicensePlate{ #Bool value specifying if the license plate credential is currently active. Default value is False. [Parameter(ValueFromPipelineByPropertyName = $true)] [bool]$active=$true, - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway [Parameter()] [ValidateNotNullOrEmpty()] @@ -64,7 +59,6 @@ function Add-VerkadaAccessUserLicensePlate{ begin { $url = "https://$($region).verkada.com/access/v1/credentials/license_plate" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -93,7 +87,7 @@ function Add-VerkadaAccessUserLicensePlate{ } try { - $response = Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method POST + $response = Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method POST return $response } catch [Microsoft.PowerShell.Commands.HttpResponseException] { diff --git a/verkadaModule/Public/Add-VerkadaAccessUserMfaCode.ps1 b/verkadaModule/Public/Add-VerkadaAccessUserMfaCode.ps1 index 6286a8a..da7d37c 100644 --- a/verkadaModule/Public/Add-VerkadaAccessUserMfaCode.ps1 +++ b/verkadaModule/Public/Add-VerkadaAccessUserMfaCode.ps1 @@ -5,18 +5,18 @@ function Add-VerkadaAccessUserMfaCode{ .DESCRIPTION Adds a mfa code credential to a user given a specified user_id or external_id and org_id. MFA code object will be passed in the body of the request as a json. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Add-VerkadaAccessMfaCode.md .EXAMPLE Add-VerkadaAccessUserMfaCode -mfaCode '9567' -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' - This adds the MFA code 9567 to the Access user's profile with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The org_id and token will be populated from the cached created by Connect-Verkada. + This adds the MFA code 9567 to the Access user's profile with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Add-VerkadaAccessUserMfaCode -mfaCode '9567' -externalId 'newUserUPN@contoso.com' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This adds the MFA code 9567 to the Access user's profile with externalId newUserUPN@contoso.com. The org_id and token are submitted as parameters in the call. + Add-VerkadaAccessUserMfaCode -mfaCode '9567' -externalId 'newUserUPN@contoso.com' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + This adds the MFA code 9567 to the Access user's profile with externalId newUserUPN@contoso.com. The token is submitted as a parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Add-VrkdaAcUsrMfaCd","a-VrkdaAcUsrMfaCd")] @@ -36,11 +36,6 @@ function Add-VerkadaAccessUserMfaCode{ [ValidatePattern('^\d{4,16}$')] [Alias('mfa_code','code')] [string]$mfaCode, - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway [Parameter()] [ValidateNotNullOrEmpty()] @@ -57,7 +52,6 @@ function Add-VerkadaAccessUserMfaCode{ begin { $url = "https://$($region).verkada.com/access/v1/credentials/mfa_code" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -83,7 +77,7 @@ function Add-VerkadaAccessUserMfaCode{ } try { - $response = Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method POST + $response = Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method POST return $response } catch [Microsoft.PowerShell.Commands.HttpResponseException] { diff --git a/verkadaModule/Public/Add-VerkadaCommandUser.ps1 b/verkadaModule/Public/Add-VerkadaCommandUser.ps1 index b0b7cc7..bc0b21c 100644 --- a/verkadaModule/Public/Add-VerkadaCommandUser.ps1 +++ b/verkadaModule/Public/Add-VerkadaCommandUser.ps1 @@ -6,34 +6,34 @@ function Add-VerkadaCommandUser{ .DESCRIPTION Creates a user in an organization. External ID required. Otherwise, the newly created user will contain a user ID which can be used for identification. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Add-VerkadaCommandUser.md .EXAMPLE Add-VerkadaCommandUser -firstName 'New' -lastName 'User' - This will add the Command user with the name "New User". The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will add the Command user with the name "New User". The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Add-VerkadaCommandUser -firstName 'New' -lastName 'User' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This will add the Command user with the name "New User". The org_id and tokens are submitted as parameters in the call. + Add-VerkadaCommandUser -firstName 'New' -lastName 'User' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + This will add the Command user with the name "New User". The token is submitted as a parameter in the call. .EXAMPLE Add-VerkadaCommandUser -firstName 'New' -lastName 'User' -email 'newUser@contoso.com' - This will add the Command user with the name "New User" and email newUser@contoso.com. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will add the Command user with the name "New User" and email newUser@contoso.com. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE Add-VerkadaCommandUser -firstName 'New' -lastName 'User' -email 'newUser@contoso.com' -externalId 'newUserUPN@contoso.com' - This will add the Command user with the name "New User", email newUser@contoso.com, and externalId newUserUPN@contoso.com. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will add the Command user with the name "New User", email newUser@contoso.com, and externalId newUserUPN@contoso.com. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE Add-VerkadaCommandUser -email 'newUser@contoso.com' - This will add the Command user with the email newUser@contoso.com. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will add the Command user with the email newUser@contoso.com. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE Add-VerkadaCommandUser -firstName 'New' -lastName 'User' -email 'newUser@contoso.com -companyName 'Contoso' -department 'sales' -departmentId 'US-Sales' -employeeId '12345' -employeeTitle 'The Closer' -employeeType 'Full Time' -phone '+18165556789' - This will add the Command user with the name "New User" and email newUser@contoso.com in department defined as sales with departmnetId of US-Sales with the appropriate companyName, employeeID, employeeTitle, employeeType and phone. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will add the Command user with the name "New User" and email newUser@contoso.com in department defined as sales with departmnetId of US-Sales with the appropriate companyName, employeeID, employeeTitle, employeeType and phone. The token will be populated from the cache created by Connect-Verkada. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Add-VrkdaCmdUsr","a-VrkdaCmdUsr")] @@ -82,11 +82,6 @@ function Add-VerkadaCommandUser{ [Parameter(ValueFromPipelineByPropertyName = $true)] [ValidatePattern("^\+[1-9]\d{10,14}$")] [String]$phone, - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway [Parameter()] [ValidateNotNullOrEmpty()] @@ -103,7 +98,6 @@ function Add-VerkadaCommandUser{ begin { $url = "https://$($region).verkada.com/core/v1/user" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -132,7 +126,7 @@ function Add-VerkadaCommandUser{ $query_params = @{} try { - $response = Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method POST + $response = Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method POST return $response } catch [Microsoft.PowerShell.Commands.HttpResponseException] { diff --git a/verkadaModule/Public/Add-VerkadaHelixEvent.ps1 b/verkadaModule/Public/Add-VerkadaHelixEvent.ps1 index 07f92e5..82ab08b 100644 --- a/verkadaModule/Public/Add-VerkadaHelixEvent.ps1 +++ b/verkadaModule/Public/Add-VerkadaHelixEvent.ps1 @@ -5,27 +5,22 @@ function Add-VerkadaHelixEvent{ .DESCRIPTION This method can be used to generate a Helix Event in Command. Users will be able to specify the attribute values for each attribute key that was previously defined in the Event Type creation process. To successfully create a Helix Event, users will need to input the associated Camera ID, API Token with Helix permissions, Event Type UID, and the exact event epoch timestamp in milliseconds. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Add-VerkadaHelixEvent.md .EXAMPLE Add-VerkadaHelixEvent -camera_id 6b8731d7-d991-4206-ba71-b5446fa617fc -event_type_uid cf918b16-26cd-4c01-a672-5a91b79311e1 -timeStamp (get-date) -attributes $attributes - This will add a new helix event for the current time for the sepcified camera, event ID, and submitted attributes. The org_id and token will be populated from the cached created by Connect-Verkada. + This will add a new helix event for the current time for the sepcified camera, event ID, and submitted attributes. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Add-VerkadaHelixEvent -camera_id 6b8731d7-d991-4206-ba71-b5446fa617fc -event_type_uid cf918b16-26cd-4c01-a672-5a91b79311e1 -timeStamp '1/1/2025 08:35:00 -06' -attributes $attributes -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This will add a new helix event for Jan 1, 2025 at 8:35 AM CST for the sepcified camera, event ID, and submitted attributes. The org_id and token are submitted as parameters in the call. + Add-VerkadaHelixEvent -camera_id 6b8731d7-d991-4206-ba71-b5446fa617fc -event_type_uid cf918b16-26cd-4c01-a672-5a91b79311e1 -timeStamp '1/1/2025 08:35:00 -06' -attributes $attributes -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + This will add a new helix event for Jan 1, 2025 at 8:35 AM CST for the sepcified camera, event ID, and submitted attributes. The token is submitted as a parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Add-VrkdaHlxEvt","a-VrkdaHlxEvt")] param ( - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The UUID of the camera who's name is being changed [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] @@ -63,7 +58,6 @@ function Add-VerkadaHelixEvent{ begin { $url = "https://$($region).verkada.com/cameras/v1/video_tagging/event" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -87,7 +81,7 @@ function Add-VerkadaHelixEvent{ $query_params = @{} try { - Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method POST + Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method POST return "Event created successfully" } catch [Microsoft.PowerShell.Commands.HttpResponseException] { diff --git a/verkadaModule/Public/Add-VerkadaLicensePlateOfInterest.ps1 b/verkadaModule/Public/Add-VerkadaLicensePlateOfInterest.ps1 index 3174701..a33c071 100644 --- a/verkadaModule/Public/Add-VerkadaLicensePlateOfInterest.ps1 +++ b/verkadaModule/Public/Add-VerkadaLicensePlateOfInterest.ps1 @@ -5,35 +5,30 @@ function Add-VerkadaLicensePlateOfInterest{ .DESCRIPTION This function uses the public api endpoint(https://api.verkada.com/cameras/v1/analytics/lpr/license_plate_of_interest) to add a License Plate of Interest to the specified 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Add-VerkadaLicensePlateOfInterest.md .EXAMPLE Add-VerkadaLicensePlateOfInterest -license_plate 'ABC123' -description 'New License Plate' - The org_id and tokens will be populated from the cached created by Connect-Verkada. + The token will be populated from the cache created by Connect-Verkada. .EXAMPLE Add-VerkadaLPoI 'ABC123' 'New License Plate' - The org_id and tokens will be populated from the cached created by Connect-Verkada. + The token will be populated from the cache created by Connect-Verkada. .EXAMPLE Import-CSV ./file_ofLicenses_and_Descriptions.csv | Add-VerkadaLPoI - The org_id and tokens will be populated from the cached created by Connect-Verkada. + The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Add-VerkadaLicensePlateOfInterest -license_plate 'ABC123' -description 'New License Plate' -org_id 'deds343-uuid-of-org' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - The org_id and tokens are submitted as parameters in the call. + Add-VerkadaLicensePlateOfInterest -license_plate 'ABC123' -description 'New License Plate' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + The token is submitted as a parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Add-VerkadaLPoI")] param ( - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The license plate number of the License Plate of Interest [Parameter(ValueFromPipelineByPropertyName = $true, Position = 0, Mandatory = $true)] [String]$license_plate, @@ -49,8 +44,8 @@ function Add-VerkadaLicensePlateOfInterest{ Begin { $url = "https://$($region).verkada.com/cameras/v1/analytics/lpr/license_plate_of_interest" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} + $myErrors = @() } #end begin Process { @@ -60,7 +55,7 @@ function Add-VerkadaLicensePlateOfInterest{ } try { - $response = Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api -body_params $body_params -method post + $response = Invoke-VerkadaRestMethod $url $x_verkada_auth_api -body_params $body_params -method post return $response } catch [Microsoft.PowerShell.Commands.HttpResponseException] { diff --git a/verkadaModule/Public/Connect-Verkada.ps1 b/verkadaModule/Public/Connect-Verkada.ps1 index 37bfe7e..4715f75 100644 --- a/verkadaModule/Public/Connect-Verkada.ps1 +++ b/verkadaModule/Public/Connect-Verkada.ps1 @@ -11,39 +11,38 @@ function Connect-Verkada https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Connect-Verkada.md .EXAMPLE - Connect-Verkada '7cd47706-f51b-4419-8675-3b9f0ce7c12d' 'myapiKey-dcwdskjnlnlkj' + Connect-Verkada -x_api_key 'myapiKey-dcwdskjnlnlkj' This will store the org_id 7cd47706-f51b-4419-8675-3b9f0ce7c12d with the public API key myapiKey-dcwdskjnlnlkj. .EXAMPLE - Connect-Verkada '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -userName "admin.user@contoso.com" -otp (Get-Otp (Get-Secret -Name myVerkadaOtp -AsPlainText)) -MyPwd (Get-Secret -Name myVerkadaPassword) -x_api_key 'myapiKey-dcwdskjnlnlkj' + Connect-Verkada -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -userName "admin.user@contoso.com" -otp (Get-Otp (Get-Secret -Name myVerkadaOtp -AsPlainText)) -MyPwd (Get-Secret -Name myVerkadaPassword) -x_api_key 'myapiKey-dcwdskjnlnlkj' This will authenticate user admin.user@contoso.com with a otp token and a secure string variable stored password([secureString]$yourPwd) and upon success store the org_id 7cd47706-f51b-4419-8675-3b9f0ce7c12d and the returned tokens. This will also store the org_id 7cd47706-f51b-4419-8675-3b9f0ce7c12d with the public API key myapiKey-dcwdskjnlnlkj .EXAMPLE - Connect-Verkada '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -userName "admin.user@contoso.com" -Password + Connect-Verkada -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -userName "admin.user@contoso.com" -Password This will authenticate user admin.user@contoso.com by prompting for the password(stored as a secure string) and upon success store the org_id 7cd47706-f51b-4419-8675-3b9f0ce7c12d and the returned tokens. This will no longer work for OrgAdmins due to the MFA requirement. .EXAMPLE - Connect-Verkada '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -userName "admin.user@contoso.com" -otp '123456' -MyPwd $yourPwd(seure string) + Connect-Verkada -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -userName "admin.user@contoso.com" -otp '123456' -MyPwd $yourPwd(seure string) This will authenticate user admin.user@contoso.com with a otp token and a secure string variable stored password([secureString]$yourPwd) and upon success store the org_id 7cd47706-f51b-4419-8675-3b9f0ce7c12d and the returned tokens. This will no longer work for OrgAdmins due to the MFA requirement. .EXAMPLE - Connect-Verkada '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'myapiKey-dcwdskjnlnlkj' -userName "admin.user@contoso.com" -Password + Connect-Verkada -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'myapiKey-dcwdskjnlnlkj' -userName "admin.user@contoso.com" -Password This will store the org_id 7cd47706-f51b-4419-8675-3b9f0ce7c12d with the public API key myapiKey-dcwdskjnlnlkj and will authenticate user admin.user@contoso.com by prompting for the password(stored as a secure string) and storing the returned tokens. This will no longer work for OrgAdmins due to the MFA requirement. #> [CmdletBinding(PositionalBinding = $true,DefaultParameterSetName='apiToken')] Param( #The UUID of the organization the user belongs to - [Parameter(ParameterSetName = 'apiToken', Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] - [Parameter(ParameterSetName = 'UnPwd', Mandatory = $true, Position = 0)] - [Parameter(ParameterSetName = 'ManualTokens', Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)] + [Parameter(ParameterSetName = 'UnPwd', Mandatory = $true)] + [Parameter(ParameterSetName = 'ManualTokens', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [ValidateNotNullOrEmpty()] [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] [String]$org_id, #The public API key to be used for calls that hit the public API gateway - [Parameter(ParameterSetName = 'apiToken', Mandatory = $true, Position = 1, ValueFromPipelineByPropertyName = $true)] - [Parameter(ParameterSetName = 'UnPwd', Position = 1)] - [Parameter(ParameterSetName = 'ManualTokens', Position = 1, ValueFromPipelineByPropertyName = $true)] + [Parameter(ParameterSetName = 'apiToken', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] + [Parameter(ParameterSetName = 'UnPwd')] + [Parameter(ParameterSetName = 'ManualTokens', ValueFromPipelineByPropertyName = $true)] [Alias('token')] [ValidateNotNullOrEmpty()] [String]$x_api_key, @@ -64,17 +63,17 @@ function Connect-Verkada [ValidateNotNullOrEmpty()] [securestring]$MyPwd, #The userToken retrieved from Command login - [Parameter(ParameterSetName = 'ManualTokens', Mandatory = $true, Position = 2, ValueFromPipelineByPropertyName = $true)] + [Parameter(ParameterSetName = 'ManualTokens', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [ValidateNotNullOrEmpty()] [Alias('x_verkada_auth')] [String]$userToken, #The csrfToken retrieved from Command login - [Parameter(ParameterSetName = 'ManualTokens', Mandatory = $true, Position = 3, ValueFromPipelineByPropertyName = $true)] + [Parameter(ParameterSetName = 'ManualTokens', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [ValidateNotNullOrEmpty()] [Alias('x_verkada_token')] [String]$csrfToken, #The usr ID retrieved from Command login - [Parameter(ParameterSetName = 'ManualTokens', Mandatory = $true, Position = 4, ValueFromPipelineByPropertyName = $true)] + [Parameter(ParameterSetName = 'ManualTokens', Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [ValidateNotNullOrEmpty()] [Alias('x-verkada-user-id')] [String]$usr, @@ -95,11 +94,14 @@ function Connect-Verkada Remove-Variable -Name verkadaCameraGroups -Scope Global -ErrorAction SilentlyContinue If (!($Global:verkadaConnection)){ $Global:verkadaConnection = @{ - org_id = $org_id region = $region } } - + + if($org_id) { + $Global:verkadaConnection.org_id = $org_id + } + if($x_api_key) { $Global:verkadaConnection.x_api_key = $x_api_key diff --git a/verkadaModule/Public/Disable-VerkadaAccessUserCard.ps1 b/verkadaModule/Public/Disable-VerkadaAccessUserCard.ps1 index c685b86..5ee23f2 100644 --- a/verkadaModule/Public/Disable-VerkadaAccessUserCard.ps1 +++ b/verkadaModule/Public/Disable-VerkadaAccessUserCard.ps1 @@ -5,18 +5,18 @@ function Disable-VerkadaAccessUserCard{ .DESCRIPTION Given the Verkada defined User ID (OR user defined External ID)and Card ID, deactivate a specific access card for a user. Returns the updated Access Card Object. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Disable-VerkadaAccessUserCard.md .EXAMPLE Disable-VerkadaAccessUserCard -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -cardId '10110010000000000000001011' - This will deactivate the credential with cardId 10110010000000000000001011 for the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 as a credential. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will deactivate the credential with cardId 10110010000000000000001011 for the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 as a credential. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Disable-VerkadaAccessUserCard -externalId 'newUserUPN@contoso.com' -cardId '10110010000000000000001011' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This will deactivate the credential with cardId 10110010000000000000001011 for the Access user with externalId newUserUPN@contoso.com as a credential. The org_id and tokens are submitted as parameters in the call. + Disable-VerkadaAccessUserCard -externalId 'newUserUPN@contoso.com' -cardId '10110010000000000000001011' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + This will deactivate the credential with cardId 10110010000000000000001011 for the Access user with externalId newUserUPN@contoso.com as a credential. The token is submitted as a parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Disable-VrkdaAcUsrCrd","d-VrkdaAcUsrCrd")] @@ -36,11 +36,6 @@ function Disable-VerkadaAccessUserCard{ [ValidatePattern('^\d*$')] [Alias('card_id')] [string]$cardId, - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway [Parameter()] [ValidateNotNullOrEmpty()] @@ -57,7 +52,6 @@ function Disable-VerkadaAccessUserCard{ begin { $url = "https://$($region).verkada.com/access/v1/credentials/card/deactivate" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -84,7 +78,7 @@ function Disable-VerkadaAccessUserCard{ } try { - $response = Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method PUT + $response = Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method PUT return $response } catch [Microsoft.PowerShell.Commands.HttpResponseException] { diff --git a/verkadaModule/Public/Disable-VerkadaAccessUserLicensePlate.ps1 b/verkadaModule/Public/Disable-VerkadaAccessUserLicensePlate.ps1 index dc12b3f..b22e5e1 100644 --- a/verkadaModule/Public/Disable-VerkadaAccessUserLicensePlate.ps1 +++ b/verkadaModule/Public/Disable-VerkadaAccessUserLicensePlate.ps1 @@ -5,18 +5,18 @@ function Disable-VerkadaAccessUserLicensePlate{ .DESCRIPTION Given the Verkada defined User ID (OR user defined External ID)and License Plate Number, deactivate a users License Plate Credential. Returns the updated License Plate Object. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Disable-VerkadaAccessUserLicensePlate.md .EXAMPLE Disable-VerkadaAccessUserLicensePlate -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -licensePlateNumber 'ABC123' - This will deactivate the license plate ABC123 for the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 as a credential. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will deactivate the license plate ABC123 for the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 as a credential. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Disable-VerkadaAccessUserLicensePlate -externalId 'newUserUPN@contoso.com' -licensePlateNumber 'ABC123' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This will deactivate the license plate ABC123 for the Access user with externalId newUserUPN@contoso.com as a credential. The org_id and tokens are submitted as parameters in the call. + Disable-VerkadaAccessUserLicensePlate -externalId 'newUserUPN@contoso.com' -licensePlateNumber 'ABC123' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + This will deactivate the license plate ABC123 for the Access user with externalId newUserUPN@contoso.com as a credential. The token is submitted as a parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Disable-VrkdaAcUsrLPR","d-VrkdaAcUsrLPR")] @@ -36,11 +36,6 @@ function Disable-VerkadaAccessUserLicensePlate{ [ValidatePattern('^\w{4,}$')] [Alias('license_plate_number')] [string]$licensePlateNumber, - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway [Parameter()] [ValidateNotNullOrEmpty()] @@ -57,7 +52,6 @@ function Disable-VerkadaAccessUserLicensePlate{ begin { $url = "https://$($region).verkada.com/access/v1/credentials/license_plate/deactivate" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -84,7 +78,7 @@ function Disable-VerkadaAccessUserLicensePlate{ } try { - $response = Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method PUT + $response = Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method PUT return $response } catch [Microsoft.PowerShell.Commands.HttpResponseException] { diff --git a/verkadaModule/Public/Disconnect-Verkada.ps1 b/verkadaModule/Public/Disconnect-Verkada.ps1 index 0a24937..a78027b 100644 --- a/verkadaModule/Public/Disconnect-Verkada.ps1 +++ b/verkadaModule/Public/Disconnect-Verkada.ps1 @@ -16,10 +16,7 @@ function Disconnect-Verkada [CmdletBinding(PositionalBinding = $true)] Param( - #The UUID of the organization the user belongs to(not implemented) - [Parameter(Position = 0)] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id + ) Process { diff --git a/verkadaModule/Public/Enable-VerkadaAccessUserCard.ps1 b/verkadaModule/Public/Enable-VerkadaAccessUserCard.ps1 index 21cec5f..4bf8225 100644 --- a/verkadaModule/Public/Enable-VerkadaAccessUserCard.ps1 +++ b/verkadaModule/Public/Enable-VerkadaAccessUserCard.ps1 @@ -5,18 +5,18 @@ function Enable-VerkadaAccessUserCard{ .DESCRIPTION Given the Verkada defined User ID (OR user defined External ID)and Card ID, activate a specific access card for a user. Returns the updated Access Card Object. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Enable-VerkadaAccessUserCard.md .EXAMPLE Enable-VerkadaAccessUserCard -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -cardId '3f3b3e4d-1a67-4b88-a321-43c5e502991c' - This will activate the credential with cardId 10110010000000000000001011 for the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 as a credential. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will activate the credential with cardId 10110010000000000000001011 for the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 as a credential. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Enable-VerkadaAccessUserCard -externalId 'newUserUPN@contoso.com' -cardId '3f3b3e4d-1a67-4b88-a321-43c5e502991c' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This will activate the credential with cardId 10110010000000000000001011 for the Access user with externalId newUserUPN@contoso.com as a credential. The org_id and tokens are submitted as parameters in the call. + Enable-VerkadaAccessUserCard -externalId 'newUserUPN@contoso.com' -cardId '3f3b3e4d-1a67-4b88-a321-43c5e502991c' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + This will activate the credential with cardId 10110010000000000000001011 for the Access user with externalId newUserUPN@contoso.com as a credential. The token is submitted as a parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Enable-VrkdaAcUsrCrd","e-VrkdaAcUsrCrd")] @@ -36,11 +36,6 @@ function Enable-VerkadaAccessUserCard{ [ValidatePattern('^\d*$')] [Alias('card_id')] [string]$cardId, - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway [Parameter()] [ValidateNotNullOrEmpty()] @@ -57,7 +52,6 @@ function Enable-VerkadaAccessUserCard{ begin { $url = "https://$($region).verkada.com/access/v1/credentials/card/activate" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -84,7 +78,7 @@ function Enable-VerkadaAccessUserCard{ } try { - $response = Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method PUT + $response = Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method PUT return $response } catch [Microsoft.PowerShell.Commands.HttpResponseException] { diff --git a/verkadaModule/Public/Enable-VerkadaAccessUserLicensePlate.ps1 b/verkadaModule/Public/Enable-VerkadaAccessUserLicensePlate.ps1 index 5efcfb1..ced924c 100644 --- a/verkadaModule/Public/Enable-VerkadaAccessUserLicensePlate.ps1 +++ b/verkadaModule/Public/Enable-VerkadaAccessUserLicensePlate.ps1 @@ -5,18 +5,18 @@ function Enable-VerkadaAccessUserLicensePlate{ .DESCRIPTION Given the Verkada defined user ID (OR user defined External ID)and License Plate Number, activate a users License Plate Credential. Returns the updated License Plate Object. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Enable-VerkadaAccessUserLicensePlate.md .EXAMPLE Enable-VerkadaAccessUserLicensePlate -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -licensePlateNumber 'ABC123' - This will activate the license plate ABC123 for the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 as a credential. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will activate the license plate ABC123 for the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 as a credential. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Enable-VerkadaAccessUserLicensePlate -externalId 'newUserUPN@contoso.com' -licensePlateNumber 'ABC123' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This will activate the license plate ABC123 for the Access user with externalId newUserUPN@contoso.com as a credential. The org_id and tokens are submitted as parameters in the call. + Enable-VerkadaAccessUserLicensePlate -externalId 'newUserUPN@contoso.com' -licensePlateNumber 'ABC123' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + This will activate the license plate ABC123 for the Access user with externalId newUserUPN@contoso.com as a credential. The token is submitted as a parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Enable-VrkdaAcUsrLPR","e-VrkdaAcUsrLPR")] @@ -36,11 +36,6 @@ function Enable-VerkadaAccessUserLicensePlate{ [ValidatePattern('^\w{4,}$')] [Alias('license_plate_number')] [string]$licensePlateNumber, - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway [Parameter()] [ValidateNotNullOrEmpty()] @@ -57,7 +52,6 @@ function Enable-VerkadaAccessUserLicensePlate{ begin { $url = "https://$($region).verkada.com/access/v1/credentials/license_plate/activate" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -84,7 +78,7 @@ function Enable-VerkadaAccessUserLicensePlate{ } try { - $response = Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method PUT + $response = Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method PUT return $response } catch [Microsoft.PowerShell.Commands.HttpResponseException] { diff --git a/verkadaModule/Public/Find-VerkadaHelixEvent.ps1 b/verkadaModule/Public/Find-VerkadaHelixEvent.ps1 index 8d73791..e3cd0c9 100644 --- a/verkadaModule/Public/Find-VerkadaHelixEvent.ps1 +++ b/verkadaModule/Public/Find-VerkadaHelixEvent.ps1 @@ -12,27 +12,22 @@ function Find-VerkadaHelixEvent{ Event Type UID: returns all Helix Events that share that specific Event Type UID. Start and End Times: returns all Helix Events that have occurred during that time range. Attributes Keys and Values: returns all Helix Events that have attributes keys and values matching the user's entered parameters. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Find-VerkadaHelixEvent.md .EXAMPLE Find-VerkadaHelixEvent -camera_id 6b8731d7-d991-4206-ba71-b5446fa617fc - This will get the helix events for camera_id 6b8731d7-d991-4206-ba71-b5446fa617fc. The org_id and token will be populated from the cached created by Connect-Verkada. + This will get the helix events for camera_id 6b8731d7-d991-4206-ba71-b5446fa617fc. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Find-VerkadaHelixEvent -event_type_uid cf918b16-26cd-4c01-a672-5a91b79311e1 -startTimeStamp '1/1/2025 08:35:00 -06' -endTimeStamp '1/7/2025 17:00:00 -06' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This will find the helix events for from Jan 1, 2025 at 8:35 AM CST to Jan 7, 2025 at 5:00 APM CST for the sepcified event ID. The org_id and token are submitted as parameters in the call. + Find-VerkadaHelixEvent -event_type_uid cf918b16-26cd-4c01-a672-5a91b79311e1 -startTimeStamp '1/1/2025 08:35:00 -06' -endTimeStamp '1/7/2025 17:00:00 -06' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + This will find the helix events for from Jan 1, 2025 at 8:35 AM CST to Jan 7, 2025 at 5:00 APM CST for the sepcified event ID. The token is submitted as parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Find-VrkdaHlxEvt","fd-VrkdaHlxEvt")] param ( - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The UUID of the camera who's name is being changed [Parameter()] [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] @@ -81,7 +76,6 @@ function Find-VerkadaHelixEvent{ begin { $url = "https://$($region).verkada.com/cameras/v1/video_tagging/event/search" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -113,7 +107,7 @@ function Find-VerkadaHelixEvent{ if ($PSBoundParameters.ContainsKey('attribute_filters')){$body_params.attribute_filters = $attribute_filters} try { - $response = Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -pagination -propertyName events -page_size 100 -method POST + $response = Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -pagination -propertyName events -page_size 100 -method POST return $response } catch [Microsoft.PowerShell.Commands.HttpResponseException] { diff --git a/verkadaModule/Public/Get-VerkadaAccessEvents.ps1 b/verkadaModule/Public/Get-VerkadaAccessEvents.ps1 index c66d107..3980f1f 100644 --- a/verkadaModule/Public/Get-VerkadaAccessEvents.ps1 +++ b/verkadaModule/Public/Get-VerkadaAccessEvents.ps1 @@ -5,27 +5,22 @@ function Get-VerkadaAccessEvents{ .DESCRIPTION Returns events for an organization within a specified time range. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Get-VerkadaAccessEvents.md .EXAMPLE Get-VerkadaAccessEvents - This will return all the access events from 1 hour in the past until present. The org_id and token will be populated from the cached created by Connect-Verkada. + This will return all the access events from 1 hour in the past until present. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Get-VerkadaAccessEvents -start_time 'January 1, 2025 9:00:00AM' -end_time 'February 8, 2025 10:30:00PM' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This will return all the access events from Jan 1 at 9am to Feb 8 at 10:30pm. The org_id and token are submitted as parameters in the call. + Get-VerkadaAccessEvents -start_time 'January 1, 2025 9:00:00AM' -end_time 'February 8, 2025 10:30:00PM' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + This will return all the access events from Jan 1 at 9am to Feb 8 at 10:30pm. The token is submitted as parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Get-VrkdaAcEvnts","gt-VrkdaAcEvnts")] param ( - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway [Parameter()] [ValidateNotNullOrEmpty()] @@ -63,7 +58,6 @@ function Get-VerkadaAccessEvents{ begin { $url = "https://$($region).verkada.com/events/v1/access" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -86,7 +80,7 @@ function Get-VerkadaAccessEvents{ if (!([string]::IsNullOrEmpty($user_id))){$query_params.user_id = $user_id -join ','} try { - $response = Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method GET -pagination -page_size 200 -propertyName 'events' + $response = Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method GET -pagination -page_size 200 -propertyName 'events' if ($toLocalTime.IsPresent){ foreach ($e in $response){ $e.timestamp = (Get-Date -Date ($e.timestamp) -AsUTC).ToLocalTime() diff --git a/verkadaModule/Public/Get-VerkadaAccessGroup.ps1 b/verkadaModule/Public/Get-VerkadaAccessGroup.ps1 index 7a27cdd..28f2707 100644 --- a/verkadaModule/Public/Get-VerkadaAccessGroup.ps1 +++ b/verkadaModule/Public/Get-VerkadaAccessGroup.ps1 @@ -5,22 +5,22 @@ function Get-VerkadaAccessGroup{ .DESCRIPTION Retrieves an access group specified by its Verkada-defined unique identifier(Group ID). The response is the Access Group Metadata Object for the desired Access Group. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Get-VerkadaAccessGroup.md .EXAMPLE Get-VerkadaAccessGroup -groupId '7858d17a-3f72-4506-8532-a4b6ba233c5e' - This will return the Access Group with userId "7858d17a-3f72-4506-8532-a4b6ba233c5e". The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will return the Access Group with userId "7858d17a-3f72-4506-8532-a4b6ba233c5e". The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Get-VerkadaAccessGroup -groupId '7858d17a-3f72-4506-8532-a4b6ba233c5e' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This will return the Access Group with userId "7858d17a-3f72-4506-8532-a4b6ba233c5e". The org_id and tokens are submitted as parameters in the call. + Get-VerkadaAccessGroup -groupId '7858d17a-3f72-4506-8532-a4b6ba233c5e' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + This will return the Access Group with userId "7858d17a-3f72-4506-8532-a4b6ba233c5e". The token is submitted as a parameter in the call. .EXAMPLE Read-VerkadaAccessGroups | Where-Object {$_.name -eq "Executive Access"} | Get-VerkadaAccessGroup - This will return the Access Group named "Executive Access". The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will return the Access Group named "Executive Access". The token will be populated from the cache created by Connect-Verkada. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Get-VrkdaAcGrp","gt-VrkdaAcGrp")] @@ -30,11 +30,6 @@ function Get-VerkadaAccessGroup{ [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] [Alias('group_id')] [String]$groupId, - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway [Parameter()] [ValidateNotNullOrEmpty()] @@ -51,7 +46,6 @@ function Get-VerkadaAccessGroup{ begin { $url = "https://$($region).verkada.com/access/v1/access_groups/group" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -68,7 +62,7 @@ function Get-VerkadaAccessGroup{ } try { - $response = Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method GET + $response = Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method GET return $response } catch [Microsoft.PowerShell.Commands.HttpResponseException] { diff --git a/verkadaModule/Public/Get-VerkadaAccessUser.ps1 b/verkadaModule/Public/Get-VerkadaAccessUser.ps1 index 17c5aa3..78bfef1 100644 --- a/verkadaModule/Public/Get-VerkadaAccessUser.ps1 +++ b/verkadaModule/Public/Get-VerkadaAccessUser.ps1 @@ -5,18 +5,18 @@ function Get-VerkadaAccessUser{ .DESCRIPTION Given the Verkada created User ID or the user defined External ID, retrieve the Access Object Information for the specified user. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Get-VerkadaAccessUser.md .EXAMPLE Get-VerkadaAccessUser -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' - This will retrieve the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will retrieve the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Get-VerkadaAccessUser -externalId 'newUserUPN@contoso.com' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This will retrieve the Access user with externalId newUserUPN@contoso.com. The org_id and tokens are submitted as parameters in the call. + Get-VerkadaAccessUser -externalId 'newUserUPN@contoso.com' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + This will retrieve the Access user with externalId newUserUPN@contoso.com. The token is submitted as a parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Get-VrkdaAcUsr","gt-VrkdaAcUsr")] @@ -31,11 +31,6 @@ function Get-VerkadaAccessUser{ [Parameter(ValueFromPipelineByPropertyName = $true)] [Alias('external_id')] [String]$externalId, - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway [Parameter()] [ValidateNotNullOrEmpty()] @@ -52,7 +47,6 @@ function Get-VerkadaAccessUser{ begin { $url = "https://$($region).verkada.com/access/v1/access_users/user" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -73,7 +67,7 @@ function Get-VerkadaAccessUser{ } try { - $response = Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method GET + $response = Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method GET return $response } catch [Microsoft.PowerShell.Commands.HttpResponseException] { diff --git a/verkadaModule/Public/Get-VerkadaAccessUserProfilePicture.ps1 b/verkadaModule/Public/Get-VerkadaAccessUserProfilePicture.ps1 index 200b3be..56b431c 100644 --- a/verkadaModule/Public/Get-VerkadaAccessUserProfilePicture.ps1 +++ b/verkadaModule/Public/Get-VerkadaAccessUserProfilePicture.ps1 @@ -5,18 +5,18 @@ function Get-VerkadaAccessUserProfilePicture{ .DESCRIPTION This will download the Access user's, specified by the user_Id or external_Id, current profile picture. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Get-VerkadaAccessUserProfilePicture.md .EXAMPLE Export-VerkadaAccessUserProfilePicture -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -outPath './MyProfilePics' - This downloads the Access user's, with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3, picture to ./MyProfilePics/801c9551-b04c-4293-84ad-b0a6aa0588b3.jpg. The org_id and token will be populated from the cached created by Connect-Verkada. + This downloads the Access user's, with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3, picture to ./MyProfilePics/801c9551-b04c-4293-84ad-b0a6aa0588b3.jpg. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Export-VerkadaAccessUserProfilePicture -externalId 'newUserUPN@contoso.com' -outPath './MyProfilePics' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This downloads the Access user's, with externalId newUserUPN@contoso.com picture to ./MyProfilePics/newUserUPN.jpg. The org_id and token are submitted as parameters in the call. + Export-VerkadaAccessUserProfilePicture -externalId 'newUserUPN@contoso.com' -outPath './MyProfilePics' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + This downloads the Access user's, with externalId newUserUPN@contoso.com picture to ./MyProfilePics/newUserUPN.jpg. The token is submitted as parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Export-VerkadaAccessUserProfilePicture","Get-VrkdaAcUsrPrflPic","g-VrkdaAcUsrPrflPic","Export-VrkdaAcUsrPrflPic","ep-VrkdaAcUsrPrflPic")] @@ -37,11 +37,6 @@ function Get-VerkadaAccessUserProfilePicture{ #The flag that states whether to download the original or cropped version [Parameter(ValueFromPipelineByPropertyName = $true)] [bool]$original=$false, - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway [Parameter()] [ValidateNotNullOrEmpty()] @@ -58,7 +53,6 @@ function Get-VerkadaAccessUserProfilePicture{ begin { $url = "https://$($region).verkada.com/access/v1/access_users/user/profile_photo" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -70,10 +64,10 @@ function Get-VerkadaAccessUserProfilePicture{ } if (!([string]::IsNullOrEmpty($userId))){ - $hasPhoto = Get-VerkadaAccessUser -userId $userId -org_id $org_id -x_verkada_auth_api $x_verkada_auth_api -region $region | Select-Object -ExpandProperty has_profile_photo + $hasPhoto = Get-VerkadaAccessUser -userId $userId -x_verkada_auth_api $x_verkada_auth_api -region $region | Select-Object -ExpandProperty has_profile_photo if (!($hasPhoto)){throw "No profile picture exists for $userId"} } elseif (!([string]::IsNullOrEmpty($externalId))){ - $hasPhoto = Get-VerkadaAccessUser -externalId $externalId -org_id $org_id -x_verkada_auth_api $x_verkada_auth_api -region $region | Select-Object -ExpandProperty has_profile_photo + $hasPhoto = Get-VerkadaAccessUser -externalId $externalId -x_verkada_auth_api $x_verkada_auth_api -region $region | Select-Object -ExpandProperty has_profile_photo if (!($hasPhoto)){throw "No profile picture exists for $externalId"} } @@ -108,7 +102,7 @@ function Get-VerkadaAccessUserProfilePicture{ } try { - Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -method GET -outFile $outFile + Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -method GET -outFile $outFile return } catch [Microsoft.PowerShell.Commands.HttpResponseException] { diff --git a/verkadaModule/Public/Get-VerkadaCameras.ps1 b/verkadaModule/Public/Get-VerkadaCameras.ps1 index 18c8f64..824f280 100644 --- a/verkadaModule/Public/Get-VerkadaCameras.ps1 +++ b/verkadaModule/Public/Get-VerkadaCameras.ps1 @@ -6,35 +6,30 @@ function Get-VerkadaCameras .DESCRIPTION This function will retrieve the complete list of cameras in an organization. Upon the first run the camera list will be cached until a new powershell session is initiated, Connect/Disconnect-Verkada is run, or you use the refresh switch. - 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Get-VerkadaCameras.md .EXAMPLE Get-VerkadaCameras - This will return all the cameras in the org. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will return all the cameras in the org. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Get-VerkadaCameras -org_id 'deds343-uuid-of-org' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This will return all the cameras in the org. The org_id and tokens are submitted as parameters in the call. + Get-VerkadaCameras -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + This will return all the cameras in the org. The token is submitted as a parameter in the call. .EXAMPLE Get-VerkadaCameras -serial - This will return the camera information using the serial. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will return the camera information using the serial. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE Get-VerkadaCameras -refresh - This will return all the cameras in the org with the most recent data available from Command. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will return all the cameras in the org with the most recent data available from Command. The token will be populated from the cache created by Connect-Verkada. #> [CmdletBinding(PositionalBinding = $true)] Param( - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true, Position = 0)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway [Parameter(Position = 1)] [ValidateNotNullOrEmpty()] @@ -56,7 +51,6 @@ function Get-VerkadaCameras $page_size = 200 $propertyName = 'cameras' #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $response = @() @@ -64,7 +58,7 @@ function Get-VerkadaCameras if ((!([string]::IsNullOrEmpty($global:verkadaCameras))) -and (!($refresh.IsPresent))) { $cameras = $Global:verkadaCameras } else { - $cameras = Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api -pagination -page_size $page_size -propertyName $propertyName + $cameras = Invoke-VerkadaRestMethod $url $x_verkada_auth_api -pagination -page_size $page_size -propertyName $propertyName $Global:verkadaCameras = $cameras } } #end begin diff --git a/verkadaModule/Public/Get-VerkadaCloudBackupSettings.ps1 b/verkadaModule/Public/Get-VerkadaCloudBackupSettings.ps1 index fa27645..59f08c9 100644 --- a/verkadaModule/Public/Get-VerkadaCloudBackupSettings.ps1 +++ b/verkadaModule/Public/Get-VerkadaCloudBackupSettings.ps1 @@ -6,22 +6,22 @@ function Get-VerkadaCloudBackupSettings .DESCRIPTION This function will retrieve the cloud backup settings of the camera requested. - 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Get-VerkadaCloudBackupSettings.md .EXAMPLE Get-VerkadaCloudBackupSettings -camera_id "cwdfwfw-3f3-cwdf2-cameraId" - This will get the cloud backup settings of camera cwdfwfw-3f3-cwdf2-cameraId. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will get the cloud backup settings of camera cwdfwfw-3f3-cwdf2-cameraId. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE Get-VerkadaCloudBackupSettings -camera_id "cwdfwfw-3f3-cwdf2-cameraId" -org_id 'deds343-uuid-of-org' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This will get the cloud backup settings of camera cwdfwfw-3f3-cwdf2-cameraId. The org_id and tokens are submitted as parameters in the call. + This will get the cloud backup settings of camera cwdfwfw-3f3-cwdf2-cameraId. The token is submitted as a parameter in the call. .EXAMPLE Get-VerkadaCloudBackupSettings -camera_id "cwdfwfw-3f3-cwdf2-cameraId" -backup - This will get the cloud backup settings of camera cwdfwfw-3f3-cwdf2-cameraId and write it to a csv. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will get the cloud backup settings of camera cwdfwfw-3f3-cwdf2-cameraId and write it to a csv. The token will be populated from the cache created by Connect-Verkada. #> [CmdletBinding(PositionalBinding = $true)] @@ -30,11 +30,9 @@ function Get-VerkadaCloudBackupSettings [Parameter(ValueFromPipelineByPropertyName = $true, Mandatory = $true, Position = 0)] [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] [String]$camera_id, - #The UUID of the organization the user belongs to - [Parameter(Position = 1)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, + #Switch used to write the retrieved cloud backup settings to a csv. This will prompt for the path and file name for the output csv when the backup switch is used + [Parameter()] + [Switch]$backup, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway [Parameter(Position = 2)] [ValidateNotNullOrEmpty()] @@ -43,14 +41,13 @@ function Get-VerkadaCloudBackupSettings [Parameter()] [ValidateSet('api','api.eu','api.au')] [String]$region='api', - #Switch used to write the retrieved cloud backup settings to a csv. This will prompt for the path and file name for the output csv when the backup switch is used + #Switch to write errors to file [Parameter()] [Switch]$backup ) Begin { #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $url = "https://$($region).verkada.com/cameras/v1/cloud_backup/settings" @@ -62,7 +59,7 @@ function Get-VerkadaCloudBackupSettings 'camera_id' = $camera_id } - $response += Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params + $response += Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params } #end process End { diff --git a/verkadaModule/Public/Get-VerkadaCommandUser.ps1 b/verkadaModule/Public/Get-VerkadaCommandUser.ps1 index 13db83b..a8d78ab 100644 --- a/verkadaModule/Public/Get-VerkadaCommandUser.ps1 +++ b/verkadaModule/Public/Get-VerkadaCommandUser.ps1 @@ -5,18 +5,18 @@ function Get-VerkadaCommandUser{ .DESCRIPTION Returns a user for an organization based on either provided user ID or an external ID set during creation. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Get-VerkadaCommandUser.md .EXAMPLE Get-VerkadaCommandUser -userId '3651fbcb-f8ba-4248-ad70-3f6512fd7b6c' - This will attempt to get the user details of a user with the userId of '3651fbcb-f8ba-4248-ad70-3f6512fd7b6c'. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will attempt to get the user details of a user with the userId of '3651fbcb-f8ba-4248-ad70-3f6512fd7b6c'. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Get-VerkadaCommandUser -externalId 'UserUPN@contoso.com' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This will attempt to get the user details of a user with the externalId UserUPN@contoso.com. The org_id and tokens are submitted as parameters in the call. + Get-VerkadaCommandUser -externalId 'UserUPN@contoso.com' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + This will attempt to get the user details of a user with the externalId UserUPN@contoso.com. The token is submitted as a parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Get-VrkdaCmdUsr","gt-VrkdaCmdUsr")] @@ -31,11 +31,6 @@ function Get-VerkadaCommandUser{ [Parameter(ValueFromPipelineByPropertyName = $true)] [Alias('external_id')] [String]$externalId, - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway [Parameter()] [ValidateNotNullOrEmpty()] @@ -52,7 +47,6 @@ function Get-VerkadaCommandUser{ begin { $url = "https://$($region).verkada.com/core/v1/user" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -73,7 +67,7 @@ function Get-VerkadaCommandUser{ } try { - $response = Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method GET + $response = Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method GET return $response } catch [Microsoft.PowerShell.Commands.HttpResponseException] { diff --git a/verkadaModule/Public/Get-VerkadaHelixEvent.ps1 b/verkadaModule/Public/Get-VerkadaHelixEvent.ps1 index cf1a96d..c4a3fc0 100644 --- a/verkadaModule/Public/Get-VerkadaHelixEvent.ps1 +++ b/verkadaModule/Public/Get-VerkadaHelixEvent.ps1 @@ -5,27 +5,22 @@ function Get-VerkadaHelixEvent{ .DESCRIPTION This method can be used to retrieve a Helix Event that has already been posted to Command. In the return message, the users will be able to see the corresponding attribute values for that unique event. To successfully retrieve a Helix Event, users will need to input the associated Camera ID, API Token with Helix permissions, Event Type UID, and the exact event epoch time in milliseconds. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Get-VerkadaHelixEvent.md .EXAMPLE Get-VerkadaHelixEvent -camera_id 6b8731d7-d991-4206-ba71-b5446fa617fc -event_type_uid cf918b16-26cd-4c01-a672-5a91b79311e1 -timeStamp '1/1/2025 08:35:00 -06' - This will get the helix event for Jan 1, 2025 at 8:35 AM CST for the sepcified camera, and event ID. The org_id and token will be populated from the cached created by Connect-Verkada. + This will get the helix event for Jan 1, 2025 at 8:35 AM CST for the sepcified camera, and event ID. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Get-VerkadaHelixEvent -camera_id 6b8731d7-d991-4206-ba71-b5446fa617fc -event_type_uid cf918b16-26cd-4c01-a672-5a91b79311e1 -timeStamp '1/1/2025 08:35:00 -06' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This will get the helix event for Jan 1, 2025 at 8:35 AM CST for the sepcified camera, and event ID. The org_id and token are submitted as parameters in the call. + Get-VerkadaHelixEvent -camera_id 6b8731d7-d991-4206-ba71-b5446fa617fc -event_type_uid cf918b16-26cd-4c01-a672-5a91b79311e1 -timeStamp '1/1/2025 08:35:00 -06' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + This will get the helix event for Jan 1, 2025 at 8:35 AM CST for the sepcified camera, and event ID. The token is submitted as a parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Get-VrkdaHlxEvt","g-VrkdaHlxEvt")] param ( - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The UUID of the camera who's name is being changed [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] @@ -58,7 +53,6 @@ function Get-VerkadaHelixEvent{ begin { $url = "https://$($region).verkada.com/cameras/v1/video_tagging/event" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -80,7 +74,7 @@ function Get-VerkadaHelixEvent{ } try { - $response = Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method GET + $response = Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method GET return $response } catch [Microsoft.PowerShell.Commands.HttpResponseException] { diff --git a/verkadaModule/Public/Get-VerkadaLicensePlatesOfInterest.ps1 b/verkadaModule/Public/Get-VerkadaLicensePlatesOfInterest.ps1 index b9e210a..d77cdec 100644 --- a/verkadaModule/Public/Get-VerkadaLicensePlatesOfInterest.ps1 +++ b/verkadaModule/Public/Get-VerkadaLicensePlatesOfInterest.ps1 @@ -5,35 +5,33 @@ function Get-VerkadaLicensePlatesOfInterest{ .DESCRIPTION This function uses the public api endpoint(https://api.verkada.com/cameras/v1/analytics/lpr/license_plate_of_interest) to returns creation time, description, and license plate number for all License Plates of Interest for 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Get-VerkadaLicensePlatesOfInterest.md .EXAMPLE Get-VerkadaLicensePlatesOfInterest - The org_id and tokens will be populated from the cached created by Connect-Verkada. + The token will be populated from the cache created by Connect-Verkada. .EXAMPLE Get-VerkadaLPoI - The org_id and tokens will be populated from the cached created by Connect-Verkada. + The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Get-VerkadaLicensePlatesOfInterest -org_id 'deds343-uuid-of-org' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - The org_id and tokens are submitted as parameters in the call. + Get-VerkadaLicensePlatesOfInterest -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + The token is submitted as a parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Get-VerkadaLPoI")] param ( - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway [Parameter(ValueFromPipelineByPropertyName = $true)] [ValidateNotNullOrEmpty()] - [String]$x_verkada_auth_api = $Global:verkadaConnection.x_verkada_auth_api + [String]$x_verkada_auth_api = $Global:verkadaConnection.x_verkada_auth_api, + #Switch to write errors to file + [Parameter()] + [switch]$errorsToFile ) begin { @@ -41,12 +39,11 @@ function Get-VerkadaLicensePlatesOfInterest{ $page_size = 1000 $propertyName = 'license_plate_of_interest' #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} } #end begin process { - $response = Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api -pagination -page_size $page_size -propertyName $propertyName + $response = Invoke-VerkadaRestMethod $url $x_verkada_auth_api -pagination -page_size $page_size -propertyName $propertyName } #end process end { diff --git a/verkadaModule/Public/Read-VerkadaAccessGroups.ps1 b/verkadaModule/Public/Read-VerkadaAccessGroups.ps1 index 370068d..a16daa0 100644 --- a/verkadaModule/Public/Read-VerkadaAccessGroups.ps1 +++ b/verkadaModule/Public/Read-VerkadaAccessGroups.ps1 @@ -5,27 +5,22 @@ function Read-VerkadaAccessGroups{ .DESCRIPTION Retrieves a list of all access groups in a given organization. The response is a list of Access Group Objects. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Read-VerkadaAccessGroups.md .EXAMPLE Read-VerkadaAccessGroups - This will return aa the Access Groups. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will return aa the Access Groups. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Read-VerkadaAccessGroups -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This will return aa the Access Groups. The org_id and tokens are submitted as parameters in the call. + Read-VerkadaAccessGroups -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + This will return aa the Access Groups. The token is submitted as a parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Read-VrkdaAcGrps","rd-VrkdaAcGrps")] param ( - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway [Parameter()] [ValidateNotNullOrEmpty()] @@ -42,7 +37,6 @@ function Read-VerkadaAccessGroups{ begin { $url = "https://$($region).verkada.com/access/v1/access_groups" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -53,7 +47,7 @@ function Read-VerkadaAccessGroups{ $query_params = @{} try { - $response = Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method GET + $response = Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method GET if (![string]::IsNullOrEmpty($response.access_groups)) {$response = $response.access_groups} return $response } diff --git a/verkadaModule/Public/Read-VerkadaAccessUsers.ps1 b/verkadaModule/Public/Read-VerkadaAccessUsers.ps1 index 27ba553..b6f9940 100644 --- a/verkadaModule/Public/Read-VerkadaAccessUsers.ps1 +++ b/verkadaModule/Public/Read-VerkadaAccessUsers.ps1 @@ -12,27 +12,22 @@ function Read-VerkadaAccessUsers{ .EXAMPLE Read-VerkadaAccessUsers - This will return all the active access users in an organization. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will return all the active access users in an organization. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE Read-VerkadaAccessUsers -userId 'aefrfefb-3429-39ec-b042-userAC' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_token 'a366ef47-2c20-4d35-a90a-10fd2aee113a' -x_verkada_auth 'auth-token-uuid-dscsdc' -usr 'a099bfe6-34ff-4976-9d53-ac68342d2b60' - This will return all the active access users in an organization. The org_id and tokens are submitted as parameters in the call. + This will return all the active access users in an organization. The token is submitted as a parameter in the call. .EXAMPLE - Read-VerkadaAccessUsers -version v1 -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This will return all the active access users in an organization using the Command v1 public API endpoint. The org_id and tokens are submitted as parameters in the call. + Read-VerkadaAccessUsers -version v1 -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + This will return all the active access users in an organization using the Command v1 public API endpoint. The token is submitted as a parameter in the call. .EXAMPLE 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 org_id and tokens will be populated from the cached created by Connect-Verkada. + 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, DefaultParameterSetName = 'legacy')] + [CmdletBinding(PositionalBinding = $true)] param ( - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #This is the graphql query to be submitted (do not use unless you know what you are doing) [Parameter(Position = 1, ParameterSetName = 'legacy')] [Object]$query, @@ -280,7 +275,6 @@ fragment AccessUserBasic on User { } elseif ($version -eq 'v1') { $url = "https://$($region).verkada.com/access/v1/access_users" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } @@ -302,7 +296,7 @@ fragment AccessUserBasic on User { $query_params = @{} try { - $response = Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method GET + $response = Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method GET $users = $response | Select-Object -ExpandProperty access_members $global:verkadaAccessUsers = $users } diff --git a/verkadaModule/Public/Read-VerkadaGuestSites.ps1 b/verkadaModule/Public/Read-VerkadaGuestSites.ps1 index dbeaef9..1b55669 100644 --- a/verkadaModule/Public/Read-VerkadaGuestSites.ps1 +++ b/verkadaModule/Public/Read-VerkadaGuestSites.ps1 @@ -5,27 +5,22 @@ function Read-VerkadaGuestSites{ .DESCRIPTION Retrieves a list of all the Guest sites in an organization. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Read-VerkadaGuestSites.md .EXAMPLE Read-VerkadaGuestSites - This will return all the Guest in an organization. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will return all the Guest in an organization. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE Read-VerkadaGuestSites -userId 'aefrfefb-3429-39ec-b042-userAC' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_token 'a366ef47-2c20-4d35-a90a-10fd2aee113a' -x_verkada_auth 'auth-token-uuid-dscsdc' -usr 'a099bfe6-34ff-4976-9d53-ac68342d2b60' - This will return all the Guest sites in an organization. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will return all the Guest sites in an organization. The token will be populated from the cache created by Connect-Verkada. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Read-VrkdaGstSte","rd-VrkdaGstSte")] param ( - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway [Parameter()] [ValidateNotNullOrEmpty()] @@ -42,7 +37,6 @@ function Read-VerkadaGuestSites{ begin { $url = "https://$($region).verkada.com/guest/v1/sites" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -53,7 +47,7 @@ function Read-VerkadaGuestSites{ $query_params = @{} try { - $response = Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method GET + $response = Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method GET if (![string]::IsNullOrEmpty($response.guest_sites)) {$response = $response.guest_sites} return $response } diff --git a/verkadaModule/Public/Remove-VerkadaAccessGroup.ps1 b/verkadaModule/Public/Remove-VerkadaAccessGroup.ps1 index a8ee1f3..48d3f2d 100644 --- a/verkadaModule/Public/Remove-VerkadaAccessGroup.ps1 +++ b/verkadaModule/Public/Remove-VerkadaAccessGroup.ps1 @@ -5,18 +5,18 @@ function Remove-VerkadaAccessGroup{ .DESCRIPTION Delete an access group with the given group identifier within the given organization. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Remove-VerkadaAccessGroup.md .EXAMPLE Remove-VerkadaAccessGroup -groupId '2d64e7de-fd95-48be-8b5c-7a23bde94f52' - This will delete the Access group with the groupId 2d64e7de-fd95-48be-8b5c-7a23bde94f52. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will delete the Access group with the groupId 2d64e7de-fd95-48be-8b5c-7a23bde94f52. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Remove-VerkadaAccessGroup -groupId '2d64e7de-fd95-48be-8b5c-7a23bde94f52' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This will delete the Access group with the groupId 2d64e7de-fd95-48be-8b5c-7a23bde94f52. The org_id and tokens are submitted as parameters in the call. + Remove-VerkadaAccessGroup -groupId '2d64e7de-fd95-48be-8b5c-7a23bde94f52' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + This will delete the Access group with the groupId 2d64e7de-fd95-48be-8b5c-7a23bde94f52. The token is submitted as a parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Remove-VrkdaAcGrp","rm-VrkdaAcGrp")] @@ -26,11 +26,6 @@ function Remove-VerkadaAccessGroup{ [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] [Alias('group_id')] [String]$groupId, - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway [Parameter()] [ValidateNotNullOrEmpty()] @@ -47,7 +42,6 @@ function Remove-VerkadaAccessGroup{ begin { $url = "https://$($region).verkada.com/access/v1/access_groups/group" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -65,7 +59,7 @@ function Remove-VerkadaAccessGroup{ } try { - Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method DELETE + Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method DELETE $response = $query_params | ConvertTo-Json | ConvertFrom-Json $response | Add-Member -NotePropertyName 'status' -NotePropertyValue 'removed' return $response diff --git a/verkadaModule/Public/Remove-VerkadaAccessUserBleUnlock.ps1 b/verkadaModule/Public/Remove-VerkadaAccessUserBleUnlock.ps1 index 8958cba..5dbb63e 100644 --- a/verkadaModule/Public/Remove-VerkadaAccessUserBleUnlock.ps1 +++ b/verkadaModule/Public/Remove-VerkadaAccessUserBleUnlock.ps1 @@ -5,18 +5,18 @@ function Remove-VerkadaAccessUserBleUnlock{ .DESCRIPTION Given the user defined External ID or Verkada defined User ID (but not both), deactivate bluetooth unlock capability for a user. Response is updated Access Information Object. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Remove-VerkadaAccessUserBleUnlock.md .EXAMPLE Remove-VerkadaAccessUserBleUnlock -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' - This will deactivate the Access user's Bluetooth unlock ability with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will deactivate the Access user's Bluetooth unlock ability with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Remove-VerkadaAccessUserBleUnlock -externalId 'newUserUPN@contoso.com' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This will deactivate the Access user's Bluetooth unlock ability with externalId newUserUPN@contoso.com. The org_id and tokens are submitted as parameters in the call. + Remove-VerkadaAccessUserBleUnlock -externalId 'newUserUPN@contoso.com' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + This will deactivate the Access user's Bluetooth unlock ability with externalId newUserUPN@contoso.com. The token is submitted as a parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Remove-VrkdaAcUsrBtUnlk","rm-VrkdaAcUsrBtUnlk")] @@ -31,11 +31,6 @@ function Remove-VerkadaAccessUserBleUnlock{ [Parameter(ValueFromPipelineByPropertyName = $true)] [Alias('external_id')] [String]$externalId, - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway [Parameter()] [ValidateNotNullOrEmpty()] @@ -52,7 +47,6 @@ function Remove-VerkadaAccessUserBleUnlock{ begin { $url = "https://$($region).verkada.com/access/v1/access_users/user/ble/deactivate" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -73,7 +67,7 @@ function Remove-VerkadaAccessUserBleUnlock{ } try { - $response = Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method PUT + $response = Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method PUT return $response } catch [Microsoft.PowerShell.Commands.HttpResponseException] { diff --git a/verkadaModule/Public/Remove-VerkadaAccessUserCard.ps1 b/verkadaModule/Public/Remove-VerkadaAccessUserCard.ps1 index bc0f300..db7259d 100644 --- a/verkadaModule/Public/Remove-VerkadaAccessUserCard.ps1 +++ b/verkadaModule/Public/Remove-VerkadaAccessUserCard.ps1 @@ -5,18 +5,18 @@ function Remove-VerkadaAccessUserCard{ .DESCRIPTION Deletes an access card of a specified access user given their user_id or external_id, the org_id, and the card_id. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Remove-VerkadaAccessUserCard.md .EXAMPLE Remove-VerkadaAccessUserCard -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -cardId '10110010000000000000001011' - This will delete the credential with cardId 10110010000000000000001011 for the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 as a credential. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will delete the credential with cardId 10110010000000000000001011 for the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 as a credential. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Remove-VerkadaAccessUserCard -externalId 'newUserUPN@contoso.com' -cardId '10110010000000000000001011' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This will delete the credential with cardId 10110010000000000000001011 for the Access user with externalId newUserUPN@contoso.com as a credential. The org_id and tokens are submitted as parameters in the call. + Remove-VerkadaAccessUserCard -externalId 'newUserUPN@contoso.com' -cardId '10110010000000000000001011' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + This will delete the credential with cardId 10110010000000000000001011 for the Access user with externalId newUserUPN@contoso.com as a credential. The token is submitted as a parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Remove-VrkdaAcUsrCrd","rm-VrkdaAcUsrCrd")] @@ -36,11 +36,6 @@ function Remove-VerkadaAccessUserCard{ [ValidatePattern('^\d*$')] [Alias('card_id')] [string]$cardId, - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway [Parameter()] [ValidateNotNullOrEmpty()] @@ -57,7 +52,6 @@ function Remove-VerkadaAccessUserCard{ begin { $url = "https://$($region).verkada.com/access/v1/credentials/card" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -84,7 +78,7 @@ function Remove-VerkadaAccessUserCard{ } try { - Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method DELETE + Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method DELETE $response = $query_params | ConvertTo-Json | ConvertFrom-Json $response | Add-Member -NotePropertyName 'status' -NotePropertyValue 'removed' return $response diff --git a/verkadaModule/Public/Remove-VerkadaAccessUserEntryCode.ps1 b/verkadaModule/Public/Remove-VerkadaAccessUserEntryCode.ps1 index d507110..d1fbeb6 100644 --- a/verkadaModule/Public/Remove-VerkadaAccessUserEntryCode.ps1 +++ b/verkadaModule/Public/Remove-VerkadaAccessUserEntryCode.ps1 @@ -5,18 +5,18 @@ function Remove-VerkadaAccessUserEntryCode{ .DESCRIPTION Given the user defined External ID or Verkada defined User ID (but not both), remove the entry code of a user. Returns the updated access information object. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Remove-VerkadaAccessUserEntryCode.md .EXAMPLE Remove-VerkadaAccessUserEntryCode -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' - This will remove the Access user's entry code with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will remove the Access user's entry code with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Remove-VerkadaAccessUserEntryCode -externalId 'newUserUPN@contoso.com' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This will remove the Access user's entry code with externalId newUserUPN@contoso.com. The org_id and tokens are submitted as parameters in the call. + Remove-VerkadaAccessUserEntryCode -externalId 'newUserUPN@contoso.com' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + This will remove the Access user's entry code with externalId newUserUPN@contoso.com. The token is submitted as a parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Remove-VrkdaAcUsrEntryCo","rm-VrkdaAcUsrEntryCo")] @@ -31,11 +31,6 @@ function Remove-VerkadaAccessUserEntryCode{ [Parameter(ValueFromPipelineByPropertyName = $true)] [Alias('external_id')] [String]$externalId, - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway [Parameter()] [ValidateNotNullOrEmpty()] @@ -52,7 +47,6 @@ function Remove-VerkadaAccessUserEntryCode{ begin { $url = "https://$($region).verkada.com/access/v1/access_users/user/entry_code" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -73,7 +67,7 @@ function Remove-VerkadaAccessUserEntryCode{ } try { - Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method DELETE + Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method DELETE $response = $query_params | ConvertTo-Json | ConvertFrom-Json $response | Add-Member -NotePropertyName 'entry_code' -NotePropertyValue 'removed' return $response diff --git a/verkadaModule/Public/Remove-VerkadaAccessUserFromGroup.ps1 b/verkadaModule/Public/Remove-VerkadaAccessUserFromGroup.ps1 index e5ad450..762191d 100644 --- a/verkadaModule/Public/Remove-VerkadaAccessUserFromGroup.ps1 +++ b/verkadaModule/Public/Remove-VerkadaAccessUserFromGroup.ps1 @@ -5,18 +5,18 @@ function Remove-VerkadaAccessUserFromGroup{ .DESCRIPTION Remove an access user from an access group with the Verkada defined group ID and the user defined either by their User ID or their External ID. Both the group ID and the User ID(or External ID) are passed as query parameters in the URL. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Remove-VerkadaAccessUserFromGroup.md .EXAMPLE Remove-VerkadaAccessUserFromGroup -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -groupId '2d64e7de-fd95-48be-8b5c-7a23bde94f52' - This will remove the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 from the group with groupId 2d64e7de-fd95-48be-8b5c-7a23bde94f52. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will remove the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 from the group with groupId 2d64e7de-fd95-48be-8b5c-7a23bde94f52. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Remove-VerkadaAccessUserFromGroup -externalId 'newUserUPN@contoso.com' -groupId '2d64e7de-fd95-48be-8b5c-7a23bde94f52' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This will remove the Access user with externalId newUserUPN@contoso.com from the group with groupId 2d64e7de-fd95-48be-8b5c-7a23bde94f52. The org_id and tokens are submitted as parameters in the call. + Remove-VerkadaAccessUserFromGroup -externalId 'newUserUPN@contoso.com' -groupId '2d64e7de-fd95-48be-8b5c-7a23bde94f52' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + This will remove the Access user with externalId newUserUPN@contoso.com from the group with groupId 2d64e7de-fd95-48be-8b5c-7a23bde94f52. The token is submitted as a parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Remove-VrkdaAcUsrFrGrp","rm-VrkdaAcUsrFrGrp")] @@ -36,11 +36,6 @@ function Remove-VerkadaAccessUserFromGroup{ [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] [Alias('group_id')] [String]$groupId, - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway [Parameter()] [ValidateNotNullOrEmpty()] @@ -57,7 +52,6 @@ function Remove-VerkadaAccessUserFromGroup{ begin { $url = "https://$($region).verkada.com/access/v1/access_groups/group/user" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -84,7 +78,7 @@ function Remove-VerkadaAccessUserFromGroup{ } try { - Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method DELETE + Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method DELETE $response = $query_params | ConvertTo-Json | ConvertFrom-Json $response | Add-Member -NotePropertyName 'status' -NotePropertyValue 'removed' return $response diff --git a/verkadaModule/Public/Remove-VerkadaAccessUserLicensePlate.ps1 b/verkadaModule/Public/Remove-VerkadaAccessUserLicensePlate.ps1 index 881651d..97d0dea 100644 --- a/verkadaModule/Public/Remove-VerkadaAccessUserLicensePlate.ps1 +++ b/verkadaModule/Public/Remove-VerkadaAccessUserLicensePlate.ps1 @@ -5,18 +5,18 @@ function Remove-VerkadaAccessUserLicensePlate{ .DESCRIPTION Deletes a license plate credential from a specified user by providing the user_id or the external_id, the org_id, and the license_plate_number. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Remove-VerkadaAccessUserLicensePlate.md .EXAMPLE Remove-VerkadaAccessUserLicensePlate -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -licensePlateNumber 'ABC123' - This will remove license plate ABC123 as a credential from the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will remove license plate ABC123 as a credential from the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Remove-VerkadaAccessUserLicensePlate -externalId 'newUserUPN@contoso.com' -licensePlateNumber 'ABC123' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This will remove license plate ABC123 as a credential from the Access user with externalId newUserUPN@contoso.com. The org_id and tokens are submitted as parameters in the call. + Remove-VerkadaAccessUserLicensePlate -externalId 'newUserUPN@contoso.com' -licensePlateNumber 'ABC123' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + This will remove license plate ABC123 as a credential from the Access user with externalId newUserUPN@contoso.com. The token is submitted as a parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Remove-VrkdaAcUsrLPR","rm-VrkdaAcUsrLPR")] @@ -36,11 +36,6 @@ function Remove-VerkadaAccessUserLicensePlate{ [ValidatePattern('^\w{4,}$')] [Alias('license_plate_number')] [string]$licensePlateNumber, - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway [Parameter()] [ValidateNotNullOrEmpty()] @@ -57,7 +52,6 @@ function Remove-VerkadaAccessUserLicensePlate{ begin { $url = "https://$($region).verkada.com/access/v1/credentials/license_plate" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -84,7 +78,7 @@ function Remove-VerkadaAccessUserLicensePlate{ } try { - Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method DELETE + Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method DELETE $response = $query_params | ConvertTo-Json | ConvertFrom-Json $response | Add-Member -NotePropertyName 'status' -NotePropertyValue 'deleted' return $response diff --git a/verkadaModule/Public/Remove-VerkadaAccessUserMfaCode.ps1 b/verkadaModule/Public/Remove-VerkadaAccessUserMfaCode.ps1 index 2e2b86a..f4d9392 100644 --- a/verkadaModule/Public/Remove-VerkadaAccessUserMfaCode.ps1 +++ b/verkadaModule/Public/Remove-VerkadaAccessUserMfaCode.ps1 @@ -5,18 +5,18 @@ function Remove-VerkadaAccessUserMfaCode{ .DESCRIPTION Deletes a mfa code credential from a specified user by providing the user_id or the external_id, the org_id, and the mfa_code. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Remove-VerkadaAccessMfaCode.md .EXAMPLE Remove-VerkadaAccessUserMfaCode -mfaCode '9567' -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' - This deletes the MFA code 9567 from the Access user's profile with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The org_id and token will be populated from the cached created by Connect-Verkada. + This deletes the MFA code 9567 from the Access user's profile with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Remove-VerkadaAccessUserMfaCode -mfaCode '9567' -externalId 'newUserUPN@contoso.com' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This deletes the MFA code 9567 from the Access user's profile with externalId newUserUPN@contoso.com. The org_id and token are submitted as parameters in the call. + Remove-VerkadaAccessUserMfaCode -mfaCode '9567' -externalId 'newUserUPN@contoso.com' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + This deletes the MFA code 9567 from the Access user's profile with externalId newUserUPN@contoso.com. The token is submitted as a parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Remove-VrkdaAcUsrMfaCd","rm-VrkdaAcUsrMfaCd")] @@ -36,11 +36,6 @@ function Remove-VerkadaAccessUserMfaCode{ [ValidatePattern('^\d{4,16}$')] [Alias('mfa_code')] [string]$mfaCode, - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway [Parameter()] [ValidateNotNullOrEmpty()] @@ -57,7 +52,6 @@ function Remove-VerkadaAccessUserMfaCode{ begin { $url = "https://$($region).verkada.com/access/v1/credentials/mfa_code" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -83,7 +77,7 @@ function Remove-VerkadaAccessUserMfaCode{ } try { - Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method Delete + Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method Delete return "Code $mfaCode successfully deleted" } catch [Microsoft.PowerShell.Commands.HttpResponseException] { diff --git a/verkadaModule/Public/Remove-VerkadaAccessUserProfilePicture.ps1 b/verkadaModule/Public/Remove-VerkadaAccessUserProfilePicture.ps1 index 0a9bc97..4e24d4b 100644 --- a/verkadaModule/Public/Remove-VerkadaAccessUserProfilePicture.ps1 +++ b/verkadaModule/Public/Remove-VerkadaAccessUserProfilePicture.ps1 @@ -5,18 +5,18 @@ function Remove-VerkadaAccessUserProfilePicture{ .DESCRIPTION This will remove the Access user's, specified by the user_Id or external_Id, profile picture. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Remove-VerkadaAccessUserProfilePicture.md .EXAMPLE Remove-VerkadaAccessUserProfilePicture -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' - This removes the Access user's profile picture with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This removes the Access user's profile picture with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Remove-VerkadaAccessUserProfilePicture -externalId 'newUserUPN@contoso.com' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This removes the Access user's profile picture with externalId newUserUPN@contoso.com. The org_id and tokens are submitted as parameters in the call. + Remove-VerkadaAccessUserProfilePicture -externalId 'newUserUPN@contoso.com' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + This removes the Access user's profile picture with externalId newUserUPN@contoso.com. The token is submitted as a parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Remove-VrkdaAcUsrPrflPic","rm-VrkdaAcUsrPrflPic")] @@ -31,11 +31,6 @@ function Remove-VerkadaAccessUserProfilePicture{ [Parameter(ValueFromPipelineByPropertyName = $true)] [Alias('external_id')] [String]$externalId, - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway [Parameter()] [ValidateNotNullOrEmpty()] @@ -52,7 +47,6 @@ function Remove-VerkadaAccessUserProfilePicture{ begin { $url = "https://$($region).verkada.com/access/v1/access_users/user/profile_photo" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -72,7 +66,7 @@ function Remove-VerkadaAccessUserProfilePicture{ } try { - Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method 'DELETE' + Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method 'DELETE' return "Profile pictured removed from user $($query_params | ConvertTo-Json -Compress)" } catch [Microsoft.PowerShell.Commands.HttpResponseException] { diff --git a/verkadaModule/Public/Remove-VerkadaAccessUserRemoteUnlock.ps1 b/verkadaModule/Public/Remove-VerkadaAccessUserRemoteUnlock.ps1 index c9111a1..33bb5fe 100644 --- a/verkadaModule/Public/Remove-VerkadaAccessUserRemoteUnlock.ps1 +++ b/verkadaModule/Public/Remove-VerkadaAccessUserRemoteUnlock.ps1 @@ -5,18 +5,18 @@ function Remove-VerkadaAccessUserRemoteUnlock{ .DESCRIPTION Given the user defined External ID or Verkada defined User ID (but not both) and the Organization ID, deactivate remote unlock capability for a user.Returns the updated Access Information Object. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Remove-VerkadaAccessUserRemoteUnlock.md .EXAMPLE Remove-VerkadaAccessUserRemoteUnlock -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' - This will deactivate the Access user's Remote unlock ability with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will deactivate the Access user's Remote unlock ability with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Remove-VerkadaAccessUserRemoteUnlock -externalId 'newUserUPN@contoso.com' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This will deactivate the Access user's Remote unlock ability with externalId newUserUPN@contoso.com. The org_id and tokens are submitted as parameters in the call. + Remove-VerkadaAccessUserRemoteUnlock -externalId 'newUserUPN@contoso.com' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + This will deactivate the Access user's Remote unlock ability with externalId newUserUPN@contoso.com. The token is submitted as a parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Remove-VrkdaAcUsrRmtUnlk","rm-VrkdaAcUsrRmtUnlk")] @@ -31,11 +31,6 @@ function Remove-VerkadaAccessUserRemoteUnlock{ [Parameter(ValueFromPipelineByPropertyName = $true)] [Alias('external_id')] [String]$externalId, - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway [Parameter()] [ValidateNotNullOrEmpty()] @@ -52,7 +47,6 @@ function Remove-VerkadaAccessUserRemoteUnlock{ begin { $url = "https://$($region).verkada.com/access/v1/access_users/user/remote_unlock/deactivate" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -73,7 +67,7 @@ function Remove-VerkadaAccessUserRemoteUnlock{ } try { - $response = Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method PUT + $response = Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method PUT return $response } catch [Microsoft.PowerShell.Commands.HttpResponseException] { diff --git a/verkadaModule/Public/Remove-VerkadaCommandUser.ps1 b/verkadaModule/Public/Remove-VerkadaCommandUser.ps1 index 5a524c0..467d1c9 100644 --- a/verkadaModule/Public/Remove-VerkadaCommandUser.ps1 +++ b/verkadaModule/Public/Remove-VerkadaCommandUser.ps1 @@ -5,18 +5,18 @@ function Remove-VerkadaCommandUser{ .DESCRIPTION Deletes a user for an organization based on either provided user ID or an external ID set during creation. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Remove-VerkadaCommandUser.md .EXAMPLE Remove-VerkadaCommandUser -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' - This will delete the Command user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will delete the Command user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Remove-VerkadaCommandUser -externalId 'newUserUPN@contoso.com' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This will delete the Command user with externalId newUserUPN@contoso.com. The org_id and tokens are submitted as parameters in the call. + Remove-VerkadaCommandUser -externalId 'newUserUPN@contoso.com' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + This will delete the Command user with externalId newUserUPN@contoso.com. The token is submitted as a parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Remove-VrkdaCmdUsr","rm-VrkdaCmdUsr")] @@ -31,11 +31,6 @@ function Remove-VerkadaCommandUser{ [Parameter(ValueFromPipelineByPropertyName = $true)] [Alias('external_id')] [String]$externalId, - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway [Parameter()] [ValidateNotNullOrEmpty()] @@ -52,7 +47,6 @@ function Remove-VerkadaCommandUser{ begin { $url = "https://$($region).verkada.com/core/v1/user" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -73,7 +67,7 @@ function Remove-VerkadaCommandUser{ } try { - Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method DELETE + Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method DELETE $response = $query_params | ConvertTo-Json | ConvertFrom-Json $response | Add-Member -NotePropertyName 'status' -NotePropertyValue 'deleted' return $response diff --git a/verkadaModule/Public/Remove-VerkadaHelixEvent.ps1 b/verkadaModule/Public/Remove-VerkadaHelixEvent.ps1 index a640ce8..76cb67d 100644 --- a/verkadaModule/Public/Remove-VerkadaHelixEvent.ps1 +++ b/verkadaModule/Public/Remove-VerkadaHelixEvent.ps1 @@ -5,27 +5,22 @@ function Remove-VerkadaHelixEvent{ .DESCRIPTION This method can be used to delete a Helix event from Command. The required parameter to successfully delete a Helix event are the associated Camera ID, API Token with Helix permissions, Event Type UID, and the exact event epoch time in milliseconds. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Remove-VerkadaHelixEvent.md .EXAMPLE Remove-VerkadaHelixEvent -camera_id 6b8731d7-d991-4206-ba71-b5446fa617fc -event_type_uid cf918b16-26cd-4c01-a672-5a91b79311e1 -timeStamp '1/1/2025 08:35:00 -06' - This will delete the helix event for Jan 1, 2025 at 8:35 AM CST for the sepcified camera, and event ID. The org_id and token will be populated from the cached created by Connect-Verkada. + This will delete the helix event for Jan 1, 2025 at 8:35 AM CST for the sepcified camera, and event ID. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Remove-VerkadaHelixEvent -camera_id 6b8731d7-d991-4206-ba71-b5446fa617fc -event_type_uid cf918b16-26cd-4c01-a672-5a91b79311e1 -timeStamp '1/1/2025 08:35:00 -06' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This will delete the helix event for Jan 1, 2025 at 8:35 AM CST for the sepcified camera, and event ID. The org_id and token are submitted as parameters in the call. + Remove-VerkadaHelixEvent -camera_id 6b8731d7-d991-4206-ba71-b5446fa617fc -event_type_uid cf918b16-26cd-4c01-a672-5a91b79311e1 -timeStamp '1/1/2025 08:35:00 -06' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + This will delete the helix event for Jan 1, 2025 at 8:35 AM CST for the sepcified camera, and event ID. The token is submitted as a parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Remove-VrkdaHlxEvt","rm-VrkdaHlxEvt")] param ( - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The UUID of the camera who's name is being changed [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] @@ -58,7 +53,6 @@ function Remove-VerkadaHelixEvent{ begin { $url = "https://$($region).verkada.com/cameras/v1/video_tagging/event" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -81,7 +75,7 @@ function Remove-VerkadaHelixEvent{ } try { - Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method DELETE + Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method DELETE return "Event deleted successfully" } catch [Microsoft.PowerShell.Commands.HttpResponseException] { diff --git a/verkadaModule/Public/Remove-VerkadaLicensePlateOfInterest.ps1 b/verkadaModule/Public/Remove-VerkadaLicensePlateOfInterest.ps1 index 6293a2a..ff68f63 100644 --- a/verkadaModule/Public/Remove-VerkadaLicensePlateOfInterest.ps1 +++ b/verkadaModule/Public/Remove-VerkadaLicensePlateOfInterest.ps1 @@ -5,35 +5,30 @@ function Remove-VerkadaLicensePlateOfInterest{ .DESCRIPTION This function uses the public api endpoint(https://api.verkada.com/cameras/v1/analytics/lpr/license_plate_of_interest) to delete a License Plate of Interest from the specified 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Remove-VerkadaLicensePlateOfInterest.md .EXAMPLE Remove-VerkadaLicensePlateOfInterest -license_plate 'ABC123' - The org_id and tokens will be populated from the cached created by Connect-Verkada. + The token will be populated from the cache created by Connect-Verkada. .EXAMPLE Remove-VerkadaLPoI 'ABC123' - The org_id and tokens will be populated from the cached created by Connect-Verkada. + The token will be populated from the cache created by Connect-Verkada. .EXAMPLE Import-CSV ./file_ofLicenses.csv | Remove-VerkadaLPoI - The org_id and tokens will be populated from the cached created by Connect-Verkada. + The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Remove-VerkadaLicensePlateOfInterest -license_plate 'ABC123' -org_id 'deds343-uuid-of-org' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - The org_id and tokens are submitted as parameters in the call. + Remove-VerkadaLicensePlateOfInterest -license_plate 'ABC123' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + The token is submitted as a parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Remove-VerkadaLPoI")] param ( - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The license plate number of the License Plate of Interest [Parameter(ValueFromPipelineByPropertyName = $true, Position = 0, Mandatory = $true)] [String]$license_plate, @@ -46,7 +41,6 @@ function Remove-VerkadaLicensePlateOfInterest{ Begin { $url = "https://$($region).verkada.com/cameras/v1/analytics/lpr/license_plate_of_interest" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} } #end begin @@ -56,7 +50,7 @@ function Remove-VerkadaLicensePlateOfInterest{ } try { - $response = Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -method delete + $response = Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -method delete return $response } catch [Microsoft.PowerShell.Commands.HttpResponseException] { diff --git a/verkadaModule/Public/Send-VerkadaPassInvite.ps1 b/verkadaModule/Public/Send-VerkadaPassInvite.ps1 index 2b2bf5f..ef2be8a 100644 --- a/verkadaModule/Public/Send-VerkadaPassInvite.ps1 +++ b/verkadaModule/Public/Send-VerkadaPassInvite.ps1 @@ -5,22 +5,22 @@ function Send-VerkadaPassInvite{ .DESCRIPTION Given the user defined External ID or Verkada defined User ID (but not both) and the Organization ID, send out a Pass App invite. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Send-VerkadaPassInvite.md .EXAMPLE Send-VerkadaPassInvite -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' - This will send an email invite to an Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will send an email invite to an Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE Send-VerkadaPassInvite -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -activateBLE - This will send an email invite to an Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 and activate BLE unlocks. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will send an email invite to an Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 and activate BLE unlocks. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Send-VerkadaPassInvite -externalId 'newUserUPN@contoso.com' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This will send an email invite to an Access user with -externalId 'newUserUPN@contoso.com'. The org_id and tokens are submitted as parameters in the call. + Send-VerkadaPassInvite -externalId 'newUserUPN@contoso.com' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + This will send an email invite to an Access user with -externalId 'newUserUPN@contoso.com'. The token is submitted as a parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Send-VrkdaPssInv","sd-VrkdaPssInv")] @@ -38,11 +38,6 @@ function Send-VerkadaPassInvite{ #Switch to also Activate BLE for the user [Parameter(ValueFromPipelineByPropertyName = $true)] [switch]$activateBLE, - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway [Parameter()] [ValidateNotNullOrEmpty()] @@ -59,7 +54,6 @@ function Send-VerkadaPassInvite{ begin { $url = "https://$($region).verkada.com/access/v1/access_users/user/pass/invite" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -80,12 +74,12 @@ function Send-VerkadaPassInvite{ } try { - Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method POST + Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method POST if($activateBLE.IsPresent){ if (!([string]::IsNullOrEmpty($userId))){ - $response = Set-VerkadaAccessUserBleUnlock -org_id $org_id -x_verkada_auth_api $x_verkada_auth_api -userId $userId -errorsToFile + $response = Set-VerkadaAccessUserBleUnlock -x_verkada_auth_api $x_verkada_auth_api -userId $userId -errorsToFile } elseif (!([string]::IsNullOrEmpty($externalId))){ - $response = Set-VerkadaAccessUserBleUnlock -org_id $org_id -x_verkada_auth_api $x_verkada_auth_api -externalId $externalId -errorsToFile + $response = Set-VerkadaAccessUserBleUnlock -x_verkada_auth_api $x_verkada_auth_api -externalId $externalId -errorsToFile } $response.invite_sent = $true } else { diff --git a/verkadaModule/Public/Set-VerkadaAccessUserBleUnlock.ps1 b/verkadaModule/Public/Set-VerkadaAccessUserBleUnlock.ps1 index 0e0ae6b..faab393 100644 --- a/verkadaModule/Public/Set-VerkadaAccessUserBleUnlock.ps1 +++ b/verkadaModule/Public/Set-VerkadaAccessUserBleUnlock.ps1 @@ -5,22 +5,22 @@ function Set-VerkadaAccessUserBleUnlock{ .DESCRIPTION Given the user defined External ID or Verkada defined User ID (but not both), activate bluetooth unlock capability for a user. Response is updated Access Information Object. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Set-VerkadaAccessUserBleUnlock.md .EXAMPLE Set-VerkadaAccessUserBleUnlock -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' - This will activate the Access user's Bluetooth unlock ability with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will activate the Access user's Bluetooth unlock ability with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE Set-VerkadaAccessUserBleUnlock -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -sendPassInvite - This will activate the Access user's Bluetooth unlock ability with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 and send an email invite for the Pass app. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will activate the Access user's Bluetooth unlock ability with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 and send an email invite for the Pass app. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Set-VerkadaAccessUserBleUnlock -externalId 'newUserUPN@contoso.com' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This will activate the Access user's Bluetooth unlock ability with externalId newUserUPN@contoso.com. The org_id and tokens are submitted as parameters in the call. + Set-VerkadaAccessUserBleUnlock -externalId 'newUserUPN@contoso.com' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + This will activate the Access user's Bluetooth unlock ability with externalId newUserUPN@contoso.com. The token is submitted as a parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Set-VrkdaAcUsrBtUnlk","st-VrkdaAcUsrBtUnlk")] @@ -38,11 +38,6 @@ function Set-VerkadaAccessUserBleUnlock{ #Switch to also send Pass invite [Parameter(ValueFromPipelineByPropertyName = $true)] [switch]$sendPassInvite, - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway [Parameter()] [ValidateNotNullOrEmpty()] @@ -59,7 +54,6 @@ function Set-VerkadaAccessUserBleUnlock{ begin { $url = "https://$($region).verkada.com/access/v1/access_users/user/ble/activate" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -80,12 +74,12 @@ function Set-VerkadaAccessUserBleUnlock{ } try { - $response = Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method PUT + $response = Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method PUT if($sendPassInvite.IsPresent){ if (!([string]::IsNullOrEmpty($userId))){ - $sendingResponse = Send-VerkadaPassInvite -org_id $org_id -x_verkada_auth_api $x_verkada_auth_api -userId $userId -errorsToFile + $sendingResponse = Send-VerkadaPassInvite -x_verkada_auth_api $x_verkada_auth_api -userId $userId -errorsToFile } elseif (!([string]::IsNullOrEmpty($externalId))){ - $sendingResponse = Send-VerkadaPassInvite -org_id $org_id -x_verkada_auth_api $x_verkada_auth_api -externalId $externalId -errorsToFile + $sendingResponse = Send-VerkadaPassInvite -x_verkada_auth_api $x_verkada_auth_api -externalId $externalId -errorsToFile } if($sendingResponse.invite_sent -eq $true){ $invite = $true diff --git a/verkadaModule/Public/Set-VerkadaAccessUserEndDate.ps1 b/verkadaModule/Public/Set-VerkadaAccessUserEndDate.ps1 index ef77ee1..dc1f8f5 100644 --- a/verkadaModule/Public/Set-VerkadaAccessUserEndDate.ps1 +++ b/verkadaModule/Public/Set-VerkadaAccessUserEndDate.ps1 @@ -5,18 +5,18 @@ function Set-VerkadaAccessUserEndDate{ .DESCRIPTION Given the user defined External ID or Verkada defined User ID (but not both), set the end date for an access users' credentials to become invalid. After this time, all methods of access will be revoked. End date value will be passed as a parameter in a json payload. Returns the updated Access Information Object. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Set-VerkadaAccessUserEndDate.md .EXAMPLE Set-VerkadaAccessUserEndDate -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -endDate '11/28/2025 08:00 AM' - This sets the Access user's access to end at 8am on Nov 28, 2025 with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This sets the Access user's access to end at 8am on Nov 28, 2025 with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Set-VerkadaAccessUserEndDate -externalId 'newUserUPN@contoso.com' -endDate (Get-Date) -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This sets the Access user's access to end immediately since you are specifiying the current date and time with externalId newUserUPN@contoso.com. The org_id and tokens are submitted as parameters in the call. + Set-VerkadaAccessUserEndDate -externalId 'newUserUPN@contoso.com' -endDate (Get-Date) -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + This sets the Access user's access to end immediately since you are specifiying the current date and time with externalId newUserUPN@contoso.com. The token is submitted as a parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Set-VrkdaAcUsrEndDt","st-VrkdaAcUsrEndDt")] @@ -35,11 +35,6 @@ function Set-VerkadaAccessUserEndDate{ [Parameter(ValueFromPipelineByPropertyName = $true)] [Alias('end_date')] [datetime]$endDate, - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway [Parameter()] [ValidateNotNullOrEmpty()] @@ -56,7 +51,6 @@ function Set-VerkadaAccessUserEndDate{ begin { $url = "https://$($region).verkada.com/access/v1/access_users/user/end_date" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -85,7 +79,7 @@ function Set-VerkadaAccessUserEndDate{ } try { - $response = Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method PUT + $response = Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method PUT return $response } catch [Microsoft.PowerShell.Commands.HttpResponseException] { diff --git a/verkadaModule/Public/Set-VerkadaAccessUserEntryCode.ps1 b/verkadaModule/Public/Set-VerkadaAccessUserEntryCode.ps1 index 4bdf1c9..b4f17ee 100644 --- a/verkadaModule/Public/Set-VerkadaAccessUserEntryCode.ps1 +++ b/verkadaModule/Public/Set-VerkadaAccessUserEntryCode.ps1 @@ -5,18 +5,18 @@ function Set-VerkadaAccessUserEntryCode{ .DESCRIPTION Given the user defined External ID or Verkada defined User ID (but not both), set the entry code for a user. Entry code value will be passed as a parameter in a json payload.Returns the updated Access Information Object. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Set-VerkadaAccessUserEntryCode.md .EXAMPLE Set-VerkadaAccessUserEntryCode -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -entryCode '12345' - This will set an entry code of 12345 to the user specified. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will set an entry code of 12345 to the user specified. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE Set-VerkadaAccessUserEntryCode -externalId 'newUserUPN@contoso.com' -entryCode '12345' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This will set an entry code of 12345 to the user specified. The org_id and tokens are submitted as parameters in the call. + This will set an entry code of 12345 to the user specified. The token is submitted as a parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Set-VrkdaAcUsrEntryCo","st-VrkdaAcUsrEntryCo")] @@ -39,11 +39,6 @@ function Set-VerkadaAccessUserEntryCode{ #The flag that states whether or not the client wants to apply the given entry code to the given user even if the entry code is already in use by another user. This will reset the other user's entry code [Parameter(ValueFromPipelineByPropertyName = $true)] [bool]$override=$false, - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway [Parameter()] [ValidateNotNullOrEmpty()] @@ -60,7 +55,6 @@ function Set-VerkadaAccessUserEntryCode{ begin { $url = "https://$($region).verkada.com/access/v1/access_users/user/entry_code" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -89,7 +83,7 @@ function Set-VerkadaAccessUserEntryCode{ } try { - $response = Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method PUT + $response = Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method PUT return $response } catch [Microsoft.PowerShell.Commands.HttpResponseException] { diff --git a/verkadaModule/Public/Set-VerkadaAccessUserGroup.ps1 b/verkadaModule/Public/Set-VerkadaAccessUserGroup.ps1 index 20f30cd..f7d7bd0 100644 --- a/verkadaModule/Public/Set-VerkadaAccessUserGroup.ps1 +++ b/verkadaModule/Public/Set-VerkadaAccessUserGroup.ps1 @@ -5,22 +5,22 @@ function Set-VerkadaAccessUserGroup{ .DESCRIPTION Add an access user to an access group with the Verkada defined Group ID and either the user defined External ID or the Verkada defined User ID.The Group ID is passed in as query parameter in the URL. The External ID or Verkada User ID(but not both) is passed in the json object in the body of the request. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Set-VerkadaAccessUserGroup.md .EXAMPLE Set-VerkadaAccessUserGroup -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -groupId '2d64e7de-fd95-48be-8b5c-7a23bde94f52' - This adds the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 to Access group with groupId 2d64e7de-fd95-48be-8b5c-7a23bde94f52. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This adds the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 to Access group with groupId 2d64e7de-fd95-48be-8b5c-7a23bde94f52. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE Set-VerkadaAccessUserGroup -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -groupName 'MyAccessGroup' - This adds the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 to Access group with groupName MyAccessGroup. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This adds the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 to Access group with groupName MyAccessGroup. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Set-VerkadaAccessUserGroup -externalId 'newUserUPN@contoso.com' -groupId '2d64e7de-fd95-48be-8b5c-7a23bde94f52' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This adds the Access user uwith xternalId newUserUPN@contoso.com to Access group with groupId 2d64e7de-fd95-48be-8b5c-7a23bde94f52. The org_id and tokens are submitted as parameters in the call. + Set-VerkadaAccessUserGroup -externalId 'newUserUPN@contoso.com' -groupId '2d64e7de-fd95-48be-8b5c-7a23bde94f52' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + This adds the Access user uwith xternalId newUserUPN@contoso.com to Access group with groupId 2d64e7de-fd95-48be-8b5c-7a23bde94f52. The token is submitted as a parameter in the call. #> [CmdletBinding(PositionalBinding = $true, DefaultParameterSetName = 'groupId')] [Alias("Set-VrkdaAcUsrGrp","st-VrkdaAcUsrGrp")] @@ -43,11 +43,6 @@ function Set-VerkadaAccessUserGroup{ #The name of the group the user should be added to [Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'groupName')] [String]$groupName, - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway [Parameter()] [ValidateNotNullOrEmpty()] @@ -64,7 +59,6 @@ function Set-VerkadaAccessUserGroup{ begin { $url = "https://$($region).verkada.com/access/v1/access_groups/group/user" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -75,7 +69,7 @@ function Set-VerkadaAccessUserGroup{ Write-Error "groupName is missing but is required!" return } - $groupId = Read-VerkadaAccessGroups -org_id $org_id -x_verkada_auth_api $x_verkada_auth_api | Where-Object {$_.name -eq $groupName} | Select-Object -ExpandProperty group_id + $groupId = Read-VerkadaAccessGroups -x_verkada_auth_api $x_verkada_auth_api | Where-Object {$_.name -eq $groupName} | Select-Object -ExpandProperty group_id if ([string]::IsNullOrEmpty($groupId)) { Write-Error "Group $groupName seems to not exist." return @@ -102,7 +96,7 @@ function Set-VerkadaAccessUserGroup{ } try { - $response = Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method PUT + $response = Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method PUT return $response } catch [Microsoft.PowerShell.Commands.HttpResponseException] { diff --git a/verkadaModule/Public/Set-VerkadaAccessUserProfilePicture.ps1 b/verkadaModule/Public/Set-VerkadaAccessUserProfilePicture.ps1 index 768369a..fa0ed1d 100644 --- a/verkadaModule/Public/Set-VerkadaAccessUserProfilePicture.ps1 +++ b/verkadaModule/Public/Set-VerkadaAccessUserProfilePicture.ps1 @@ -5,18 +5,18 @@ function Set-VerkadaAccessUserProfilePicture{ .DESCRIPTION This will set the Access user's, specified by the user_Id or external_ID, profile picture. This must be a png or jpeg/jpg format image. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Set-VerkadaAccessUserProfilePicture.md .EXAMPLE Set-VerkadaAccessUserProfilePicture -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -imagePath './myPicture.jpg' - This sets the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 to use the picture specified at path ./myPicture.jpg. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This sets the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 to use the picture specified at path ./myPicture.jpg. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Set-VerkadaAccessUserProfilePicture -externalId 'newUserUPN@contoso.com' -imagePath './myPicture.png' -overwrite $true -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This sets the Access user with externalId newUserUPN@contoso.com to use the picture specified at path ./myPicture.png and will overwrite the existing photo. The org_id and tokens are submitted as parameters in the call. + Set-VerkadaAccessUserProfilePicture -externalId 'newUserUPN@contoso.com' -imagePath './myPicture.png' -overwrite $true -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + This sets the Access user with externalId newUserUPN@contoso.com to use the picture specified at path ./myPicture.png and will overwrite the existing photo. The token is submitted as a parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Set-VrkdaAcUsrPrflPic","s-VrkdaAcUsrPrflPic")] @@ -39,11 +39,6 @@ function Set-VerkadaAccessUserProfilePicture{ #The flag that states whether to overwrite the existing profile photo [Parameter(ValueFromPipelineByPropertyName = $true)] [bool]$overwrite=$false, - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway [Parameter()] [ValidateNotNullOrEmpty()] @@ -60,7 +55,6 @@ function Set-VerkadaAccessUserProfilePicture{ begin { $url = "https://$($region).verkada.com/access/v1/access_users/user/profile_photo" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -86,7 +80,7 @@ function Set-VerkadaAccessUserProfilePicture{ } try { - Invoke-VerkadaFormCall $url $org_id $form -query_params $query_params -x_verkada_auth_api $x_verkada_auth_api -Method 'PUT' + Invoke-VerkadaFormCall $url $form -query_params $query_params -x_verkada_auth_api $x_verkada_auth_api -Method 'PUT' return "Successfully uploaded $imagePath to $($query_params | ConvertTo-Json -Compress)" } catch [Microsoft.PowerShell.Commands.HttpResponseException] { diff --git a/verkadaModule/Public/Set-VerkadaAccessUserRemoteUnlock.ps1 b/verkadaModule/Public/Set-VerkadaAccessUserRemoteUnlock.ps1 index 06c869e..1ad2aaa 100644 --- a/verkadaModule/Public/Set-VerkadaAccessUserRemoteUnlock.ps1 +++ b/verkadaModule/Public/Set-VerkadaAccessUserRemoteUnlock.ps1 @@ -5,18 +5,18 @@ function Set-VerkadaAccessUserRemoteUnlock{ .DESCRIPTION Given the user defined External ID or Verkada defined User ID (but not both) and the Organization Id, activate remote unlock capability for a user.Returns the updated Access Information Object. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Set-VerkadaAccessUserRemoteUnlock.md .EXAMPLE Set-VerkadaAccessUserRemoteUnlock -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' - This will activate the Access user's Remote unlock ability with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will activate the Access user's Remote unlock ability with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Set-VerkadaAccessUserRemoteUnlock -externalId 'newUserUPN@contoso.com' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This will activate the Access user's Remote unlock ability with externalId newUserUPN@contoso.com. The org_id and tokens are submitted as parameters in the call. + Set-VerkadaAccessUserRemoteUnlock -externalId 'newUserUPN@contoso.com' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + This will activate the Access user's Remote unlock ability with externalId newUserUPN@contoso.com. The token is submitted as a parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Set-VrkdaAcUsrRmtUnlk","st-VrkdaAcUsrRmtUnlk")] @@ -31,11 +31,6 @@ function Set-VerkadaAccessUserRemoteUnlock{ [Parameter(ValueFromPipelineByPropertyName = $true)] [Alias('external_id')] [String]$externalId, - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway [Parameter()] [ValidateNotNullOrEmpty()] @@ -52,7 +47,6 @@ function Set-VerkadaAccessUserRemoteUnlock{ begin { $url = "https://$($region).verkada.com/access/v1/access_users/user/remote_unlock/activate" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -73,7 +67,7 @@ function Set-VerkadaAccessUserRemoteUnlock{ } try { - $response = Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method PUT + $response = Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method PUT return $response } catch [Microsoft.PowerShell.Commands.HttpResponseException] { diff --git a/verkadaModule/Public/Set-VerkadaAccessUserStartDate.ps1 b/verkadaModule/Public/Set-VerkadaAccessUserStartDate.ps1 index 84a7e2b..a250c42 100644 --- a/verkadaModule/Public/Set-VerkadaAccessUserStartDate.ps1 +++ b/verkadaModule/Public/Set-VerkadaAccessUserStartDate.ps1 @@ -5,18 +5,18 @@ function Set-VerkadaAccessUserStartDate{ .DESCRIPTION Given the user defined External ID or Verkada defined User ID (but not both), set the start date for an access users credentials to become valid. Before this time, all methods of access specified for this access user will invalid. Start date value will be passed as a parameter in a json payload. Returns the updated Access Information Object. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Set-VerkadaAccessUserStartDate.md .EXAMPLE Set-VerkadaAccessUserStartDate -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -startDate '1/28/2022 08:00 AM' - This sets the Access user's access to start at 8am on Jan 28, 2022 with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This sets the Access user's access to start at 8am on Jan 28, 2022 with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Set-VerkadaAccessUserStartDate -externalId 'newUserUPN@contoso.com' -startDate (Get-Date) -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This sets the Access user's access to start immediately since you are specifiying the current date and time with externalId newUserUPN@contoso.com. The org_id and tokens are submitted as parameters in the call. + Set-VerkadaAccessUserStartDate -externalId 'newUserUPN@contoso.com' -startDate (Get-Date) -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + This sets the Access user's access to start immediately since you are specifiying the current date and time with externalId newUserUPN@contoso.com. The token is submitted as a parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Set-VrkdaAcUsrStrtDt","st-VrkdaAcUsrStrtDt")] @@ -35,11 +35,6 @@ function Set-VerkadaAccessUserStartDate{ [Parameter(ValueFromPipelineByPropertyName = $true)] [Alias('start_date')] [datetime]$startDate, - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway [Parameter()] [ValidateNotNullOrEmpty()] @@ -56,7 +51,6 @@ function Set-VerkadaAccessUserStartDate{ begin { $url = "https://$($region).verkada.com/access/v1/access_users/user/start_date" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -85,7 +79,7 @@ function Set-VerkadaAccessUserStartDate{ } try { - $response = Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method PUT + $response = Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method PUT return $response } catch [Microsoft.PowerShell.Commands.HttpResponseException] { diff --git a/verkadaModule/Public/Set-VerkadaCloudBackupSettings.ps1 b/verkadaModule/Public/Set-VerkadaCloudBackupSettings.ps1 index 29d259a..d642a64 100644 --- a/verkadaModule/Public/Set-VerkadaCloudBackupSettings.ps1 +++ b/verkadaModule/Public/Set-VerkadaCloudBackupSettings.ps1 @@ -6,22 +6,22 @@ function Set-VerkadaCloudBackupSettings .DESCRIPTION This function set the cloud back settings for a camera or cameras. - 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Set-VerkadaCloudBackupSettings.md .EXAMPLE Set-VerkadaCloudBackupSettings -enabled 1 -upload_timeslot '0,86400' -time_to_preserve '25200,68400' -days_to_preserve '1,1,1,1,1,1,1' -video_to_upload 'ALL' -video_quality 'STANDARD_QUALITY' -camera_id 'cwdfwfw-3f3-cwdf2-cameraId' - This will set the camera cwdfwfw-3f3-cwdf2-cameraId to use cloud backup with the submitted settings. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will set the camera cwdfwfw-3f3-cwdf2-cameraId to use cloud backup with the submitted settings. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE Set-VerkadaCloudBackupSettings -enabled 1 -upload_timeslot '0,86400' -time_to_preserve '25200,68400' -days_to_preserve '1,1,1,1,1,1,1' -video_to_upload 'ALL' -video_quality 'STANDARD_QUALITY' -camera_id 'cwdfwfw-3f3-cwdf2-cameraId' -org_id 'deds343-uuid-of-org' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This will set the camera cwdfwfw-3f3-cwdf2-cameraId to use cloud backup with the submitted settings. The org_id and tokens are submitted as parameters in the call. + This will set the camera cwdfwfw-3f3-cwdf2-cameraId to use cloud backup with the submitted settings. The token is submitted as a parameter in the call. .EXAMPLE import-Csv ./cameras.csv | Set-VerkadaCloudBackupSettings - This will set the camera cloud backup settings for all the rows in the CSV which contains all needed params. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will set the camera cloud backup settings for all the rows in the CSV which contains all needed params. The token will be populated from the cache created by Connect-Verkada. #> [CmdletBinding(PositionalBinding = $true)] @@ -30,11 +30,6 @@ function Set-VerkadaCloudBackupSettings [Parameter(ValueFromPipelineByPropertyName = $true, Mandatory = $true, Position = 0)] [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] [String]$camera_id, - #The UUID of the organization the user belongs to - [Parameter(Position = 1)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway [Parameter(Position = 2)] [ValidateNotNullOrEmpty()] @@ -71,7 +66,6 @@ function Set-VerkadaCloudBackupSettings Begin { #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $url = "https://$($region).verkada.com/cameras/v1/cloud_backup/settings" @@ -82,7 +76,6 @@ function Set-VerkadaCloudBackupSettings Process { $body_params = @{ 'camera_id' = $camera_id - 'org_id' = $org_id 'days_to_preserve' = $days_to_preserve 'enabled' = $enabled 'time_to_preserve' = $time_to_preserve @@ -95,7 +88,7 @@ function Set-VerkadaCloudBackupSettings 'camera_id' = $camera_id } - Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method post + Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method post $result += ($body_params | ConvertTo-Json | ConvertFrom-Json) } #end process diff --git a/verkadaModule/Public/Set-VerkadaCommandUser.ps1 b/verkadaModule/Public/Set-VerkadaCommandUser.ps1 index 2d88038..45370e7 100644 --- a/verkadaModule/Public/Set-VerkadaCommandUser.ps1 +++ b/verkadaModule/Public/Set-VerkadaCommandUser.ps1 @@ -5,30 +5,30 @@ function Set-VerkadaCommandUser{ .DESCRIPTION Updates a user's metadata for an organization based on either provided user ID or an external ID set during creation. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Set-VerkadaCommandUser.md .EXAMPLE Set-VerkadaCommandUser -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -firstName 'New' -lastName 'User' - This will update the Command user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 with the name "New User". The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will update the Command user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 with the name "New User". The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Set-VerkadaCommandUser -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -firstName 'New' -lastName 'User' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This will update the Command user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 with the name "New User". The org_id and tokens are submitted as parameters in the call. + Set-VerkadaCommandUser -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -firstName 'New' -lastName 'User' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + This will update the Command user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 with the name "New User". The token is submitted as a parameter in the call. .EXAMPLE Set-VerkadaCommandUser -externalId 'newUserUPN@contoso.com' -email 'newUser@contoso.com' - This will update the Command user with externalId newUserUPN@contoso.com with the email newUser@contoso.com. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will update the Command user with externalId newUserUPN@contoso.com with the email newUser@contoso.com. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE Set-VerkadaCommandUser -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -externalId 'newUserUPN@contoso.com' - This will update the Command user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 to have the new externalId newUPN@contoso.com. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will update the Command user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 to have the new externalId newUPN@contoso.com. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE Set-VerkadaCommandUser -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -firstName 'New' -lastName 'User' -email 'newUser@contoso.com -companyName 'Contoso' -department 'sales' -departmentId 'US-Sales' -employeeId '12345' -employeeTitle 'The Closer' -employeeType 'Full Time' -phone '+18165556789' - This will update the Command user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 to the name "New User" and email newUser@contoso.com in department defined as sales with departmnetId of US-Sales with the appropriate companyName, employeeID, employeeTitle, employeeType and phone. The org_id and tokens will be populated from the cached created by Connect-Verkada. + This will update the Command user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 to the name "New User" and email newUser@contoso.com in department defined as sales with departmnetId of US-Sales with the appropriate companyName, employeeID, employeeTitle, employeeType and phone. The token will be populated from the cache created by Connect-Verkada. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Set-VrkdaCmdUsr","st-VrkdaCmdUsr")] @@ -83,11 +83,6 @@ function Set-VerkadaCommandUser{ [Parameter(ValueFromPipelineByPropertyName = $true)] [ValidatePattern("^\+[1-9]\d{10,14}$")] [String]$phone, - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway [Parameter()] [ValidateNotNullOrEmpty()] @@ -104,7 +99,6 @@ function Set-VerkadaCommandUser{ begin { $url = "https://$($region).verkada.com/core/v1/user" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -137,7 +131,7 @@ function Set-VerkadaCommandUser{ } try { - $response = Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method PUT + $response = Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method PUT return $response } catch [Microsoft.PowerShell.Commands.HttpResponseException] { diff --git a/verkadaModule/Public/Set-VerkadaHelixEvent.ps1 b/verkadaModule/Public/Set-VerkadaHelixEvent.ps1 index 6d081d7..0d31ae1 100644 --- a/verkadaModule/Public/Set-VerkadaHelixEvent.ps1 +++ b/verkadaModule/Public/Set-VerkadaHelixEvent.ps1 @@ -5,27 +5,22 @@ function Set-VerkadaHelixEvent{ .DESCRIPTION This method can be used to update a Helix Event that has already been posted to Command. This is especially useful if a user needs to add an additional attribute key to the existing event, along with its new corresponding value. To successfully update a Helix Event, users will need to input the associated Camera ID, API Token with Helix permissions, Event Type UID, exact event epoch time in milliseconds, as well as the new attribute key and attribute value that is being updated. - The org_id and reqired token 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Set-VerkadaHelixEvent.md .EXAMPLE Get-VerkadaHelixEvent -camera_id 6b8731d7-d991-4206-ba71-b5446fa617fc -event_type_uid cf918b16-26cd-4c01-a672-5a91b79311e1 -timeStamp '1/1/2025 08:35:00 -06' -attributes $attributes - This will get the helix event for Jan 1, 2025 at 8:35 AM CST for the sepcified camera, event ID, and submitted attributes. The org_id and token will be populated from the cached created by Connect-Verkada. + This will get the helix event for Jan 1, 2025 at 8:35 AM CST for the sepcified camera, event ID, and submitted attributes. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Get-VerkadaHelixEvent -camera_id 6b8731d7-d991-4206-ba71-b5446fa617fc -event_type_uid cf918b16-26cd-4c01-a672-5a91b79311e1 -timeStamp '1/1/2025 08:35:00 -06' -attributes $attributes -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - This will get the helix event for Jan 1, 2025 at 8:35 AM CST for the sepcified camera, event ID, and submitted attributes. The org_id and token are submitted as parameters in the call. + Get-VerkadaHelixEvent -camera_id 6b8731d7-d991-4206-ba71-b5446fa617fc -event_type_uid cf918b16-26cd-4c01-a672-5a91b79311e1 -timeStamp '1/1/2025 08:35:00 -06' -attributes $attributes -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + This will get the helix event for Jan 1, 2025 at 8:35 AM CST for the sepcified camera, event ID, and submitted attributes. The token is submitted as a parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Set-VrkdaHlxEvt","st-VrkdaHlxEvt")] param ( - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The UUID of the camera who's name is being changed [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)] [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] @@ -63,7 +58,6 @@ function Set-VerkadaHelixEvent{ begin { $url = "https://$($region).verkada.com/cameras/v1/video_tagging/event" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin @@ -88,7 +82,7 @@ function Set-VerkadaHelixEvent{ } try { - Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method PATCH + Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method PATCH return "Event updated successfully" } catch [Microsoft.PowerShell.Commands.HttpResponseException] { diff --git a/verkadaModule/Public/Set-VerkadaLicensePlateOfInterest.ps1 b/verkadaModule/Public/Set-VerkadaLicensePlateOfInterest.ps1 index 8b3c580..4d99d73 100644 --- a/verkadaModule/Public/Set-VerkadaLicensePlateOfInterest.ps1 +++ b/verkadaModule/Public/Set-VerkadaLicensePlateOfInterest.ps1 @@ -5,35 +5,30 @@ function Set-VerkadaLicensePlateOfInterest{ .DESCRIPTION This function uses the public api endpoint(https://api.verkada.com/cameras/v1/analytics/lpr/license_plate_of_interest) to update a License Plate of Interest to the specified 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. + The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Set-VerkadaLicensePlateOfInterest.md .EXAMPLE Set-VerkadaLicensePlateOfInterest -license_plate 'ABC123' -description 'New License Plate Descriptionv2' - The org_id and tokens will be populated from the cached created by Connect-Verkada. + The token will be populated from the cache created by Connect-Verkada. .EXAMPLE Set-VerkadaLPoI 'ABC123' 'New License Plate Descriptionv2' - The org_id and tokens will be populated from the cached created by Connect-Verkada. + The token will be populated from the cache created by Connect-Verkada. .EXAMPLE Import-CSV ./file_ofLicenses_and_Descriptions.csv | Set-VerkadaLPoI - The org_id and tokens will be populated from the cached created by Connect-Verkada. + The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Set-VerkadaLicensePlateOfInterest -license_plate 'ABC123' -description 'New License Plate Descriptionv2' -org_id 'deds343-uuid-of-org' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' - The org_id and tokens are submitted as parameters in the call. + Set-VerkadaLicensePlateOfInterest -license_plate 'ABC123' -description 'New License Plate Descriptionv2' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + The token is submitted as a parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] [Alias("Set-VerkadaLPoI")] param ( - #The UUID of the organization the user belongs to - [Parameter(ValueFromPipelineByPropertyName = $true)] - [ValidateNotNullOrEmpty()] - [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] - [String]$org_id = $Global:verkadaConnection.org_id, #The license plate number of the License Plate of Interest [Parameter(ValueFromPipelineByPropertyName = $true, Position = 0, Mandatory = $true)] [String]$license_plate, @@ -49,7 +44,6 @@ function Set-VerkadaLicensePlateOfInterest{ Begin { $url = "https://$($region).verkada.com/cameras/v1/analytics/lpr/license_plate_of_interest" #parameter validation - if ([string]::IsNullOrEmpty($org_id)) {throw "org_id is missing but is required!"} if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} } #end begin @@ -63,7 +57,7 @@ function Set-VerkadaLicensePlateOfInterest{ } try { - $response = Invoke-VerkadaRestMethod $url $org_id $x_verkada_auth_api $query_params -body_params $body_params -method patch + $response = Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method patch return $response } catch [Microsoft.PowerShell.Commands.HttpResponseException] { From 94b0e80829c3007b9690e8f09a77d3048f2164d4 Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Thu, 23 Oct 2025 20:30:11 -0500 Subject: [PATCH 2/3] Clean-up older functions Updated functions to to conform with standard naming conventions `Add-VerkadaCameraLicensePlateOfInterest`, `Get-VerkadaCameraCloudBackupSettings`, `Remove-VerkadaCameraLicensePlateOfInterest`, `Set-VerkadaCameraCloudBackupSettings`, and `Set-VerkadaCameraLicensePlateOfInterest` Update functions to use standard function format `Add-VerkadaCameraLicensePlateOfInterest`, `Get-VerkadaCameraCloudBackupSettings`, `Get-VerkadaCameras`, `Remove-VerkadaCameraLicensePlateOfInterest`, `Set-VerkadaCameraCloudBackupSettings`, and `Set-VerkadaCameraLicensePlateOfInterest` closes #284 --- ...d-VerkadaCameraLicensePlateOfInterest.ps1} | 63 ++++++++---- ... Get-VerkadaCameraCloudBackupSettings.ps1} | 74 ++++++++++----- verkadaModule/Public/Get-VerkadaCameras.ps1 | 95 ++++++++++++------- ...e-VerkadaCameraLicensePlateOfInterest.ps1} | 64 +++++++++---- ... Set-VerkadaCameraCloudBackupSettings.ps1} | 94 +++++++++++------- ...t-VerkadaCameraLicensePlateOfInterest.ps1} | 62 ++++++++---- verkadaModule/verkadaModule.psd1 | 74 ++++++++------- 7 files changed, 348 insertions(+), 178 deletions(-) rename verkadaModule/Public/{Add-VerkadaLicensePlateOfInterest.ps1 => Add-VerkadaCameraLicensePlateOfInterest.ps1} (57%) rename verkadaModule/Public/{Get-VerkadaCloudBackupSettings.ps1 => Get-VerkadaCameraCloudBackupSettings.ps1} (56%) rename verkadaModule/Public/{Remove-VerkadaLicensePlateOfInterest.ps1 => Remove-VerkadaCameraLicensePlateOfInterest.ps1} (52%) rename verkadaModule/Public/{Set-VerkadaCloudBackupSettings.ps1 => Set-VerkadaCameraCloudBackupSettings.ps1} (66%) rename verkadaModule/Public/{Set-VerkadaLicensePlateOfInterest.ps1 => Set-VerkadaCameraLicensePlateOfInterest.ps1} (56%) diff --git a/verkadaModule/Public/Add-VerkadaLicensePlateOfInterest.ps1 b/verkadaModule/Public/Add-VerkadaCameraLicensePlateOfInterest.ps1 similarity index 57% rename from verkadaModule/Public/Add-VerkadaLicensePlateOfInterest.ps1 rename to verkadaModule/Public/Add-VerkadaCameraLicensePlateOfInterest.ps1 index a33c071..091b0b0 100644 --- a/verkadaModule/Public/Add-VerkadaLicensePlateOfInterest.ps1 +++ b/verkadaModule/Public/Add-VerkadaCameraLicensePlateOfInterest.ps1 @@ -1,17 +1,17 @@ -function Add-VerkadaLicensePlateOfInterest{ +function Add-VerkadaCameraLicensePlateOfInterest{ <# .SYNOPSIS - Creates a License Plate of Interest for an organization using a specified description and license plate number. + Creates a License Plate of Interest for an organization using a specified description and license plate number using https://apidocs.verkada.com/reference/postlicenseplateofinterestviewv1 .DESCRIPTION - This function uses the public api endpoint(https://api.verkada.com/cameras/v1/analytics/lpr/license_plate_of_interest) to add a License Plate of Interest to the specified organization. + Creates a License Plate of Interest for an organization using a specified description and license plate number. The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK - https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Add-VerkadaLicensePlateOfInterest.md + https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Add-VerkadaCameraLicensePlateOfInterest.md .EXAMPLE - Add-VerkadaLicensePlateOfInterest -license_plate 'ABC123' -description 'New License Plate' + Add-VerkadaCameraLicensePlateOfInterest -license_plate 'ABC123' -description 'New License Plate' The token will be populated from the cache created by Connect-Verkada. .EXAMPLE @@ -23,11 +23,11 @@ function Add-VerkadaLicensePlateOfInterest{ The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Add-VerkadaLicensePlateOfInterest -license_plate 'ABC123' -description 'New License Plate' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + Add-VerkadaCameraLicensePlateOfInterest -license_plate 'ABC123' -description 'New License Plate' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' The token is submitted as a parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] - [Alias("Add-VerkadaLPoI")] + [Alias("Add-VerkadaLicensePlateOfInterest","Add-VerkadaLPoI","Add-VrkdaLPoI","a-VrkdaLPoI")] param ( #The license plate number of the License Plate of Interest [Parameter(ValueFromPipelineByPropertyName = $true, Position = 0, Mandatory = $true)] @@ -36,37 +36,62 @@ function Add-VerkadaLicensePlateOfInterest{ [Parameter(ValueFromPipelineByPropertyName = $true, Position = 1, Mandatory = $true)] [String]$description, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway - [Parameter(ValueFromPipelineByPropertyName = $true)] + [Parameter()] [ValidateNotNullOrEmpty()] - [String]$x_verkada_auth_api = $Global:verkadaConnection.x_verkada_auth_api + [String]$x_verkada_auth_api = $Global:verkadaConnection.x_verkada_auth_api, + #The region of the public API to be used + [Parameter()] + [ValidateSet('api','api.eu','api.au')] + [String]$region='api', + #Switch to write errors to file + [Parameter()] + [switch]$errorsToFile ) - - Begin { + + begin { $url = "https://$($region).verkada.com/cameras/v1/analytics/lpr/license_plate_of_interest" #parameter validation if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} $myErrors = @() } #end begin - Process { + process { $body_params = @{ 'description' = $description 'license_plate' = $license_plate } - + + $query_params = @{} + try { - $response = Invoke-VerkadaRestMethod $url $x_verkada_auth_api -body_params $body_params -method post - return $response + $response = Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method POST + return $response } catch [Microsoft.PowerShell.Commands.HttpResponseException] { $err = $_.ErrorDetails | ConvertFrom-Json $errorMes = $_ | Convertto-Json -WarningAction SilentlyContinue $err | Add-Member -NotePropertyName StatusCode -NotePropertyValue (($errorMes | ConvertFrom-Json -Depth 100 -WarningAction SilentlyContinue).Exception.Response.StatusCode) -Force - - throw "$($err.StatusCode) - $($err.message)" + $msg = "$($err.StatusCode) - $($err.message)" + $msg += ": $(($query_params + $body_params) | ConvertTo-Json -Compress)" + Write-Error $msg + $myErrors += $msg + $msg = $null + } + catch [VerkadaRestMethodException] { + $msg = $_.ToString() + $msg += ": $(($query_params + $body_params) | ConvertTo-Json -Compress)" + Write-Error $msg + $myErrors += $msg + $msg = $null } } #end process - - End { + + end { + if ($errorsToFile.IsPresent){ + if (![string]::IsNullOrEmpty($myErrors)){ + Get-Date | Out-File ./errors.txt -Append + $myErrors | Out-File ./errors.txt -Append + } + } } #end end } #end function \ No newline at end of file diff --git a/verkadaModule/Public/Get-VerkadaCloudBackupSettings.ps1 b/verkadaModule/Public/Get-VerkadaCameraCloudBackupSettings.ps1 similarity index 56% rename from verkadaModule/Public/Get-VerkadaCloudBackupSettings.ps1 rename to verkadaModule/Public/Get-VerkadaCameraCloudBackupSettings.ps1 index 59f08c9..4ea4b3c 100644 --- a/verkadaModule/Public/Get-VerkadaCloudBackupSettings.ps1 +++ b/verkadaModule/Public/Get-VerkadaCameraCloudBackupSettings.ps1 @@ -1,40 +1,39 @@ -function Get-VerkadaCloudBackupSettings -{ +function Get-VerkadaCameraCloudBackupSettings{ <# .SYNOPSIS - Gets a camera's cloud backup settings - + Gets a camera's cloud backup settings using https://apidocs.verkada.com/reference/getcloudbackupviewv1 + .DESCRIPTION This function will retrieve the cloud backup settings of the camera requested. The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. - + .LINK - https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Get-VerkadaCloudBackupSettings.md + https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Get-VerkadaCameraCloudBackupSettings.md .EXAMPLE - Get-VerkadaCloudBackupSettings -camera_id "cwdfwfw-3f3-cwdf2-cameraId" + Get-VerkadaCameraCloudBackupSettings -camera_id "cwdfwfw-3f3-cwdf2-cameraId" This will get the cloud backup settings of camera cwdfwfw-3f3-cwdf2-cameraId. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Get-VerkadaCloudBackupSettings -camera_id "cwdfwfw-3f3-cwdf2-cameraId" -org_id 'deds343-uuid-of-org' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + Get-VerkadaCameraCloudBackupSettings -camera_id "cwdfwfw-3f3-cwdf2-cameraId" -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' This will get the cloud backup settings of camera cwdfwfw-3f3-cwdf2-cameraId. The token is submitted as a parameter in the call. .EXAMPLE - Get-VerkadaCloudBackupSettings -camera_id "cwdfwfw-3f3-cwdf2-cameraId" -backup + Get-VerkadaCameraCloudBackupSettings -camera_id "cwdfwfw-3f3-cwdf2-cameraId" -backup This will get the cloud backup settings of camera cwdfwfw-3f3-cwdf2-cameraId and write it to a csv. The token will be populated from the cache created by Connect-Verkada. #> - [CmdletBinding(PositionalBinding = $true)] - Param( + [Alias("Get-VerkadaCloudBackupSettings","Get-VrkdaCamCbStngs","gt-VrkdaCamCbStngs")] + param ( #The UUID of the camera who's cloud backup seetings are being retrieved - [Parameter(ValueFromPipelineByPropertyName = $true, Mandatory = $true, Position = 0)] + [Parameter(ValueFromPipelineByPropertyName = $true, Mandatory = $true)] [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] [String]$camera_id, #Switch used to write the retrieved cloud backup settings to a csv. This will prompt for the path and file name for the output csv when the backup switch is used [Parameter()] [Switch]$backup, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway - [Parameter(Position = 2)] + [Parameter()] [ValidateNotNullOrEmpty()] [String]$x_verkada_auth_api = $Global:verkadaConnection.x_verkada_auth_api, #The region of the public API to be used @@ -43,26 +42,55 @@ function Get-VerkadaCloudBackupSettings [String]$region='api', #Switch to write errors to file [Parameter()] - [Switch]$backup + [switch]$errorsToFile ) - - Begin { - #parameter validation - if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} + begin { $url = "https://$($region).verkada.com/cameras/v1/cloud_backup/settings" + #parameter validation + if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} + $myErrors = @() + $response = @() - } #end beging + } #end begin - Process { + process { + $body_params = @{} + $query_params = @{ 'camera_id' = $camera_id } - - $response += Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params + + try { + $response += Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method GET + } + catch [Microsoft.PowerShell.Commands.HttpResponseException] { + $err = $_.ErrorDetails | ConvertFrom-Json + $errorMes = $_ | Convertto-Json -WarningAction SilentlyContinue + $err | Add-Member -NotePropertyName StatusCode -NotePropertyValue (($errorMes | ConvertFrom-Json -Depth 100 -WarningAction SilentlyContinue).Exception.Response.StatusCode) -Force + $msg = "$($err.StatusCode) - $($err.message)" + $msg += ": $(($query_params + $body_params) | ConvertTo-Json -Compress)" + Write-Error $msg + $myErrors += $msg + $msg = $null + } + catch [VerkadaRestMethodException] { + $msg = $_.ToString() + $msg += ": $(($query_params + $body_params) | ConvertTo-Json -Compress)" + Write-Error $msg + $myErrors += $msg + $msg = $null + } } #end process + + end { + if ($errorsToFile.IsPresent){ + if (![string]::IsNullOrEmpty($myErrors)){ + Get-Date | Out-File ./errors.txt -Append + $myErrors | Out-File ./errors.txt -Append + } + } - End { if ($backup){ try { $response | Export-Csv -Path (Read-Host 'Enter full path where CSV should be saved with filename') diff --git a/verkadaModule/Public/Get-VerkadaCameras.ps1 b/verkadaModule/Public/Get-VerkadaCameras.ps1 index 824f280..cb02763 100644 --- a/verkadaModule/Public/Get-VerkadaCameras.ps1 +++ b/verkadaModule/Public/Get-VerkadaCameras.ps1 @@ -1,13 +1,12 @@ -function Get-VerkadaCameras -{ +function Get-VerkadaCameras{ <# .SYNOPSIS - Gets all cameras in an organization - + Gets all the cameras and their details using https://apidocs.verkada.com/reference/getcamerainfoviewv1 + .DESCRIPTION - This function will retrieve the complete list of cameras in an organization. Upon the first run the camera list will be cached until a new powershell session is initiated, Connect/Disconnect-Verkada is run, or you use the refresh switch. + Returns details of all cameras within the organization. Details returned per camera are name, site, location, model, serial number, camera ID, MAC address, local IP, device retention, extended cloud retention (if any), date camera added to command, firmware update status, camera status, location latitude, location longitude, and location angle (in degrees). The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. - + .LINK https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Get-VerkadaCameras.md @@ -27,51 +26,83 @@ function Get-VerkadaCameras Get-VerkadaCameras -refresh This will return all the cameras in the org with the most recent data available from Command. The token will be populated from the cache created by Connect-Verkada. #> - [CmdletBinding(PositionalBinding = $true)] - Param( + [Alias("Get-VrkdaCams","gt-VrkdaCams","Read-VerkadaCameras","Read-VrkdaCams","rd-VrkdaCams")] + param ( + #The serial of the camera you are querying + [Parameter(ValueFromPipelineByPropertyName = $true)] + [String]$serial, + #Switch to force a refreshed list of cameras from Command + [Parameter()] + [switch]$refresh, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway - [Parameter(Position = 1)] + [Parameter()] [ValidateNotNullOrEmpty()] [String]$x_verkada_auth_api = $Global:verkadaConnection.x_verkada_auth_api, #The region of the public API to be used [Parameter()] [ValidateSet('api','api.eu','api.au')] [String]$region='api', - #The serial of the camera you are querying - [Parameter(ValueFromPipelineByPropertyName = $true, Position = 2)] - [String]$serial, - #Switch to force a refreshed list of cameras from Command + #Switch to write errors to file [Parameter()] - [switch]$refresh + [switch]$errorsToFile ) - - Begin { + + begin { $url = "https://$($region).verkada.com/cameras/v1/devices" - $page_size = 200 - $propertyName = 'cameras' #parameter validation if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} + $myErrors = @() + $page_size = 200 + $propertyName = 'cameras' $response = @() - - if ((!([string]::IsNullOrEmpty($global:verkadaCameras))) -and (!($refresh.IsPresent))) { - $cameras = $Global:verkadaCameras - } else { - $cameras = Invoke-VerkadaRestMethod $url $x_verkada_auth_api -pagination -page_size $page_size -propertyName $propertyName - $Global:verkadaCameras = $cameras - } } #end begin - Process { - if ($serial) { - $response += $cameras | Where-Object {$_.serial -eq $serial} - } else { - $response += $cameras + process { + $body_params = @{} + $query_params = @{} + + try { + if ((!([string]::IsNullOrEmpty($global:verkadaCameras))) -and (!($refresh.IsPresent))) { + $cameras = $Global:verkadaCameras + } else { + $cameras = Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -pagination -page_size $page_size -propertyName $propertyName + $Global:verkadaCameras = $cameras + } + + if ($serial) { + $response += $cameras | Where-Object {$_.serial -eq $serial} + } else { + $response += $cameras + } + } + catch [Microsoft.PowerShell.Commands.HttpResponseException] { + $err = $_.ErrorDetails | ConvertFrom-Json + $errorMes = $_ | Convertto-Json -WarningAction SilentlyContinue + $err | Add-Member -NotePropertyName StatusCode -NotePropertyValue (($errorMes | ConvertFrom-Json -Depth 100 -WarningAction SilentlyContinue).Exception.Response.StatusCode) -Force + $msg = "$($err.StatusCode) - $($err.message)" + $msg += ": $(($query_params + $body_params) | ConvertTo-Json -Compress)" + Write-Error $msg + $myErrors += $msg + $msg = $null + } + catch [VerkadaRestMethodException] { + $msg = $_.ToString() + $msg += ": $(($query_params + $body_params) | ConvertTo-Json -Compress)" + Write-Error $msg + $myErrors += $msg + $msg = $null } } #end process - - End { + + end { + if ($errorsToFile.IsPresent){ + if (![string]::IsNullOrEmpty($myErrors)){ + Get-Date | Out-File ./errors.txt -Append + $myErrors | Out-File ./errors.txt -Append + } + } return $response } #end end } #end function \ No newline at end of file diff --git a/verkadaModule/Public/Remove-VerkadaLicensePlateOfInterest.ps1 b/verkadaModule/Public/Remove-VerkadaCameraLicensePlateOfInterest.ps1 similarity index 52% rename from verkadaModule/Public/Remove-VerkadaLicensePlateOfInterest.ps1 rename to verkadaModule/Public/Remove-VerkadaCameraLicensePlateOfInterest.ps1 index ff68f63..51d205f 100644 --- a/verkadaModule/Public/Remove-VerkadaLicensePlateOfInterest.ps1 +++ b/verkadaModule/Public/Remove-VerkadaCameraLicensePlateOfInterest.ps1 @@ -1,17 +1,17 @@ -function Remove-VerkadaLicensePlateOfInterest{ +function Remove-VerkadaCameraLicensePlateOfInterest{ <# .SYNOPSIS - Deletes a License Plate of Interest for an organization using a license plate number. + This removes a license plate from being an LPoI using https://apidocs.verkada.com/reference/deletelicenseplateofinterestviewv1 .DESCRIPTION - This function uses the public api endpoint(https://api.verkada.com/cameras/v1/analytics/lpr/license_plate_of_interest) to delete a License Plate of Interest from the specified organization. + Deletes a license plate from License Plates of Interest using a specified license plate number. The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK - https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Remove-VerkadaLicensePlateOfInterest.md + https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Remove-VerkadaCameraLicensePlateOfInterest.md .EXAMPLE - Remove-VerkadaLicensePlateOfInterest -license_plate 'ABC123' + Remove-VerkadaCameraLicensePlateOfInterest -license_plate 'ABC123' The token will be populated from the cache created by Connect-Verkada. .EXAMPLE @@ -23,45 +23,71 @@ function Remove-VerkadaLicensePlateOfInterest{ The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Remove-VerkadaLicensePlateOfInterest -license_plate 'ABC123' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + Remove-VerkadaCameraLicensePlateOfInterest -license_plate 'ABC123' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' The token is submitted as a parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] - [Alias("Remove-VerkadaLPoI")] + [Alias("Remove-VerkadaLicensePlateOfInterest","Remove-VerkadaLPoI","Remove-VrkdaLPoI","rm-VrkdaLPoI")] param ( #The license plate number of the License Plate of Interest [Parameter(ValueFromPipelineByPropertyName = $true, Position = 0, Mandatory = $true)] [String]$license_plate, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway - [Parameter(ValueFromPipelineByPropertyName = $true)] + [Parameter()] [ValidateNotNullOrEmpty()] - [String]$x_verkada_auth_api = $Global:verkadaConnection.x_verkada_auth_api + [String]$x_verkada_auth_api = $Global:verkadaConnection.x_verkada_auth_api, + #The region of the public API to be used + [Parameter()] + [ValidateSet('api','api.eu','api.au')] + [String]$region='api', + #Switch to write errors to file + [Parameter()] + [switch]$errorsToFile ) - - Begin { + + begin { $url = "https://$($region).verkada.com/cameras/v1/analytics/lpr/license_plate_of_interest" #parameter validation if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} + $myErrors = @() } #end begin - Process { + process { + $body_params = @{} + $query_params = @{ 'license_plate' = $license_plate } - + try { - $response = Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -method delete - return $response + $response = Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method DELETE + return $response } catch [Microsoft.PowerShell.Commands.HttpResponseException] { $err = $_.ErrorDetails | ConvertFrom-Json $errorMes = $_ | Convertto-Json -WarningAction SilentlyContinue $err | Add-Member -NotePropertyName StatusCode -NotePropertyValue (($errorMes | ConvertFrom-Json -Depth 100 -WarningAction SilentlyContinue).Exception.Response.StatusCode) -Force - - throw "$($err.StatusCode) - $($err.message)" + $msg = "$($err.StatusCode) - $($err.message)" + $msg += ": $(($query_params + $body_params) | ConvertTo-Json -Compress)" + Write-Error $msg + $myErrors += $msg + $msg = $null + } + catch [VerkadaRestMethodException] { + $msg = $_.ToString() + $msg += ": $(($query_params + $body_params) | ConvertTo-Json -Compress)" + Write-Error $msg + $myErrors += $msg + $msg = $null } } #end process - - End { + + end { + if ($errorsToFile.IsPresent){ + if (![string]::IsNullOrEmpty($myErrors)){ + Get-Date | Out-File ./errors.txt -Append + $myErrors | Out-File ./errors.txt -Append + } + } } #end end } #end function \ No newline at end of file diff --git a/verkadaModule/Public/Set-VerkadaCloudBackupSettings.ps1 b/verkadaModule/Public/Set-VerkadaCameraCloudBackupSettings.ps1 similarity index 66% rename from verkadaModule/Public/Set-VerkadaCloudBackupSettings.ps1 rename to verkadaModule/Public/Set-VerkadaCameraCloudBackupSettings.ps1 index d642a64..273b4bd 100644 --- a/verkadaModule/Public/Set-VerkadaCloudBackupSettings.ps1 +++ b/verkadaModule/Public/Set-VerkadaCameraCloudBackupSettings.ps1 @@ -1,43 +1,34 @@ -function Set-VerkadaCloudBackupSettings -{ +function Set-VerkadaCameraCloudBackupSettings{ <# .SYNOPSIS - Sets a camera's cloud backup settings - + This updates the cloud backup settings for a camera using https://apidocs.verkada.com/reference/postcloudbackupviewv1 + .DESCRIPTION This function set the cloud back settings for a camera or cameras. The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. - + .LINK - https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Set-VerkadaCloudBackupSettings.md + https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Set-VerkadaCameraCloudBackupSettings.md .EXAMPLE - Set-VerkadaCloudBackupSettings -enabled 1 -upload_timeslot '0,86400' -time_to_preserve '25200,68400' -days_to_preserve '1,1,1,1,1,1,1' -video_to_upload 'ALL' -video_quality 'STANDARD_QUALITY' -camera_id 'cwdfwfw-3f3-cwdf2-cameraId' + Set-VerkadaCameraCloudBackupSettings -enabled 1 -upload_timeslot '0,86400' -time_to_preserve '25200,68400' -days_to_preserve '1,1,1,1,1,1,1' -video_to_upload 'ALL' -video_quality 'STANDARD_QUALITY' -camera_id 'cwdfwfw-3f3-cwdf2-cameraId' This will set the camera cwdfwfw-3f3-cwdf2-cameraId to use cloud backup with the submitted settings. The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Set-VerkadaCloudBackupSettings -enabled 1 -upload_timeslot '0,86400' -time_to_preserve '25200,68400' -days_to_preserve '1,1,1,1,1,1,1' -video_to_upload 'ALL' -video_quality 'STANDARD_QUALITY' -camera_id 'cwdfwfw-3f3-cwdf2-cameraId' -org_id 'deds343-uuid-of-org' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + Set-VerkadaCameraCloudBackupSettings -enabled 1 -upload_timeslot '0,86400' -time_to_preserve '25200,68400' -days_to_preserve '1,1,1,1,1,1,1' -video_to_upload 'ALL' -video_quality 'STANDARD_QUALITY' -camera_id 'cwdfwfw-3f3-cwdf2-cameraId' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' This will set the camera cwdfwfw-3f3-cwdf2-cameraId to use cloud backup with the submitted settings. The token is submitted as a parameter in the call. .EXAMPLE - import-Csv ./cameras.csv | Set-VerkadaCloudBackupSettings + import-Csv ./cameras.csv | Set-VerkadaCameraCloudBackupSettings This will set the camera cloud backup settings for all the rows in the CSV which contains all needed params. The token will be populated from the cache created by Connect-Verkada. #> - [CmdletBinding(PositionalBinding = $true)] - Param( + [Alias("Set-VerkadaCloudBackupSettings","Set-VrkdaCamCbStngs","s-VrkdaCamCbStngs")] + param ( #The UUID of the camera who's cloud backup seetings are being changed [Parameter(ValueFromPipelineByPropertyName = $true, Mandatory = $true, Position = 0)] [ValidatePattern('^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$')] [String]$camera_id, - #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway - [Parameter(Position = 2)] - [ValidateNotNullOrEmpty()] - [String]$x_verkada_auth_api = $Global:verkadaConnection.x_verkada_auth_api, - #The region of the public API to be used - [Parameter()] - [ValidateSet('api','api.eu','api.au')] - [String]$region='api', #Delimited list of booleans indicating which days footage should be uploaded. The elements in the array indicate the following days in order: Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday. If value is 1, cloud backup is on for that day. If value is 0, cloud backup is off for that day. For example, 0,1,1,1,1,1,0 means only backup on weekdays. [Parameter(ValueFromPipelineByPropertyName = $true, Mandatory = $true)] [ValidatePattern("[0-1],[0-1],[0-1],[0-1],[0-1],[0-1],[0-1]")] @@ -61,19 +52,30 @@ function Set-VerkadaCloudBackupSettings #The type of video that is backed-up. Two values are possible: MOTION and ALL. [Parameter(ValueFromPipelineByPropertyName = $true, Mandatory = $true)] [ValidateSet("MOTION","ALL")] - [String]$video_to_upload + [String]$video_to_upload, + #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway + [Parameter()] + [ValidateNotNullOrEmpty()] + [String]$x_verkada_auth_api = $Global:verkadaConnection.x_verkada_auth_api, + #The region of the public API to be used + [Parameter()] + [ValidateSet('api','api.eu','api.au')] + [String]$region='api', + #Switch to write errors to file + [Parameter()] + [switch]$errorsToFile ) - - Begin { + + begin { + $url = "https://$($region).verkada.com/cameras/v1/cloud_backup/settings" #parameter validation if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} - - $url = "https://$($region).verkada.com/cameras/v1/cloud_backup/settings" - $result = @() + $myErrors = @() + Write-Warning "Have you backed up your configs first? If not, consider halting and running Get-VerkadaCloudBackupSettings -backup" -WarningAction Inquire } #end begin - - Process { + + process { $body_params = @{ 'camera_id' = $camera_id 'days_to_preserve' = $days_to_preserve @@ -87,12 +89,36 @@ function Set-VerkadaCloudBackupSettings $query_params = @{ 'camera_id' = $camera_id } - - Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method post - $result += ($body_params | ConvertTo-Json | ConvertFrom-Json) + + try { + Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method POST + return ($body_params | ConvertTo-Json | ConvertFrom-Json) + } + catch [Microsoft.PowerShell.Commands.HttpResponseException] { + $err = $_.ErrorDetails | ConvertFrom-Json + $errorMes = $_ | Convertto-Json -WarningAction SilentlyContinue + $err | Add-Member -NotePropertyName StatusCode -NotePropertyValue (($errorMes | ConvertFrom-Json -Depth 100 -WarningAction SilentlyContinue).Exception.Response.StatusCode) -Force + $msg = "$($err.StatusCode) - $($err.message)" + $msg += ": $(($query_params + $body_params) | ConvertTo-Json -Compress)" + Write-Error $msg + $myErrors += $msg + $msg = $null + } + catch [VerkadaRestMethodException] { + $msg = $_.ToString() + $msg += ": $(($query_params + $body_params) | ConvertTo-Json -Compress)" + Write-Error $msg + $myErrors += $msg + $msg = $null + } } #end process - - End { - return $result + + end { + if ($errorsToFile.IsPresent){ + if (![string]::IsNullOrEmpty($myErrors)){ + Get-Date | Out-File ./errors.txt -Append + $myErrors | Out-File ./errors.txt -Append + } + } } #end end -} #end function +} #end function \ No newline at end of file diff --git a/verkadaModule/Public/Set-VerkadaLicensePlateOfInterest.ps1 b/verkadaModule/Public/Set-VerkadaCameraLicensePlateOfInterest.ps1 similarity index 56% rename from verkadaModule/Public/Set-VerkadaLicensePlateOfInterest.ps1 rename to verkadaModule/Public/Set-VerkadaCameraLicensePlateOfInterest.ps1 index 4d99d73..48b72b0 100644 --- a/verkadaModule/Public/Set-VerkadaLicensePlateOfInterest.ps1 +++ b/verkadaModule/Public/Set-VerkadaCameraLicensePlateOfInterest.ps1 @@ -1,17 +1,17 @@ -function Set-VerkadaLicensePlateOfInterest{ +function Set-VerkadaCameraLicensePlateOfInterest{ <# .SYNOPSIS - Updates a License Plate of Interest for an organization using a specified description and license plate number. + Updates a License Plate of Interest for an organization using https://apidocs.verkada.com/reference/patchlicenseplateofinterestviewv1 .DESCRIPTION - This function uses the public api endpoint(https://api.verkada.com/cameras/v1/analytics/lpr/license_plate_of_interest) to update a License Plate of Interest to the specified organization. + Updates a license plate description from License Plates of Interest using a specified license plate number. The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. .LINK - https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Set-VerkadaLicensePlateOfInterest.md + https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Set-VerkadaCameraLicensePlateOfInterest.md .EXAMPLE - Set-VerkadaLicensePlateOfInterest -license_plate 'ABC123' -description 'New License Plate Descriptionv2' + Set-VerkadaCameraLicensePlateOfInterest -license_plate 'ABC123' -description 'New License Plate Descriptionv2' The token will be populated from the cache created by Connect-Verkada. .EXAMPLE @@ -23,11 +23,11 @@ function Set-VerkadaLicensePlateOfInterest{ The token will be populated from the cache created by Connect-Verkada. .EXAMPLE - Set-VerkadaLicensePlateOfInterest -license_plate 'ABC123' -description 'New License Plate Descriptionv2' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' + Set-VerkadaCameraLicensePlateOfInterest -license_plate 'ABC123' -description 'New License Plate Descriptionv2' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' The token is submitted as a parameter in the call. #> [CmdletBinding(PositionalBinding = $true)] - [Alias("Set-VerkadaLPoI")] + [Alias("Set-VerkadaLicensePlateOfInterest","Set-VerkadaLPoI","Set-VrkdaLPoI","s-VrkdaLPoI")] param ( #The license plate number of the License Plate of Interest [Parameter(ValueFromPipelineByPropertyName = $true, Position = 0, Mandatory = $true)] @@ -36,18 +36,26 @@ function Set-VerkadaLicensePlateOfInterest{ [Parameter(ValueFromPipelineByPropertyName = $true, Position = 1, Mandatory = $true)] [String]$description, #The public API token obatined via the Login endpoint to be used for calls that hit the public API gateway - [Parameter(ValueFromPipelineByPropertyName = $true)] + [Parameter()] [ValidateNotNullOrEmpty()] - [String]$x_verkada_auth_api = $Global:verkadaConnection.x_verkada_auth_api + [String]$x_verkada_auth_api = $Global:verkadaConnection.x_verkada_auth_api, + #The region of the public API to be used + [Parameter()] + [ValidateSet('api','api.eu','api.au')] + [String]$region='api', + #Switch to write errors to file + [Parameter()] + [switch]$errorsToFile ) - - Begin { + + begin { $url = "https://$($region).verkada.com/cameras/v1/analytics/lpr/license_plate_of_interest" #parameter validation if ([string]::IsNullOrEmpty($x_verkada_auth_api)) {throw "x_verkada_auth_api is missing but is required!"} + $myErrors = @() } #end begin - Process { + process { $body_params = @{ 'description' = $description } @@ -55,20 +63,36 @@ function Set-VerkadaLicensePlateOfInterest{ $query_params = @{ 'license_plate' = $license_plate } - + try { - $response = Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method patch - return $response + $response = Invoke-VerkadaRestMethod $url $x_verkada_auth_api $query_params -body_params $body_params -method PATCH + return $response } catch [Microsoft.PowerShell.Commands.HttpResponseException] { $err = $_.ErrorDetails | ConvertFrom-Json $errorMes = $_ | Convertto-Json -WarningAction SilentlyContinue $err | Add-Member -NotePropertyName StatusCode -NotePropertyValue (($errorMes | ConvertFrom-Json -Depth 100 -WarningAction SilentlyContinue).Exception.Response.StatusCode) -Force - - throw "$($err.StatusCode) - $($err.message)" + $msg = "$($err.StatusCode) - $($err.message)" + $msg += ": $(($query_params + $body_params) | ConvertTo-Json -Compress)" + Write-Error $msg + $myErrors += $msg + $msg = $null + } + catch [VerkadaRestMethodException] { + $msg = $_.ToString() + $msg += ": $(($query_params + $body_params) | ConvertTo-Json -Compress)" + Write-Error $msg + $myErrors += $msg + $msg = $null } } #end process - - End { + + end { + if ($errorsToFile.IsPresent){ + if (![string]::IsNullOrEmpty($myErrors)){ + Get-Date | Out-File ./errors.txt -Append + $myErrors | Out-File ./errors.txt -Append + } + } } #end end } #end function \ No newline at end of file diff --git a/verkadaModule/verkadaModule.psd1 b/verkadaModule/verkadaModule.psd1 index 58131ce..7806761 100644 --- a/verkadaModule/verkadaModule.psd1 +++ b/verkadaModule/verkadaModule.psd1 @@ -72,8 +72,8 @@ PowerShellVersion = '6.1' FunctionsToExport = 'Add-VerkadaAccessGroup', 'Add-VerkadaAccessSiteAdmin', 'Add-VerkadaAccessUserCard', 'Add-VerkadaAccessUserLicensePlate', 'Add-VerkadaAccessUserMfaCode', 'Add-VerkadaCamera', - 'Add-VerkadaCommandSite', 'Add-VerkadaCommandUser', - 'Add-VerkadaHelixEvent', 'Add-VerkadaLicensePlateOfInterest', + 'Add-VerkadaCameraLicensePlateOfInterest', 'Add-VerkadaCommandSite', + 'Add-VerkadaCommandUser', 'Add-VerkadaHelixEvent', 'Add-VerkadaWorkplaceEmployee', 'Connect-Verkada', 'Disable-VerkadaAccessUserCard', 'Disable-VerkadaAccessUserLicensePlate', 'Disconnect-Verkada', @@ -87,10 +87,11 @@ FunctionsToExport = 'Add-VerkadaAccessGroup', 'Add-VerkadaAccessSiteAdmin', 'Get-VerkadaAccessUser', 'Get-VerkadaAccessUserProfilePicture', 'Get-VerkadaAccessUserReport', 'Get-VerkadaAccessUserViaGraphql', 'Get-VerkadaAlarmsDevices', 'Get-VerkadaAlarmsSiteConfig', - 'Get-VerkadaAlarmsSiteContacts', 'Get-VerkadaCameraConfig', + 'Get-VerkadaAlarmsSiteContacts', + 'Get-VerkadaCameraCloudBackupSettings', 'Get-VerkadaCameraConfig', 'Get-VerkadaCameraGroup', 'Get-VerkadaCameras', - 'Get-VerkadaCloudBackupSettings', 'Get-VerkadaCommandUser', - 'Get-VerkadaHelixEvent', 'Get-VerkadaLicensePlatesOfInterest', + 'Get-VerkadaCommandUser', 'Get-VerkadaHelixEvent', + 'Get-VerkadaLicensePlatesOfInterest', 'Get-VerkadaWorkplaceEmployee', 'Read-VerkadaAccessEntities', 'Read-VerkadaAccessGroups', 'Read-VerkadaAccessSchedules', 'Read-VerkadaAccessUsers', 'Read-VerkadaAlarmsSites', @@ -103,8 +104,9 @@ FunctionsToExport = 'Add-VerkadaAccessGroup', 'Add-VerkadaAccessSiteAdmin', 'Remove-VerkadaAccessUserMfaCode', 'Remove-VerkadaAccessUserProfilePicture', 'Remove-VerkadaAccessUserRemoteUnlock', - 'Remove-VerkadaCameraArchive', 'Remove-VerkadaCommandUser', - 'Remove-VerkadaHelixEvent', 'Remove-VerkadaLicensePlateOfInterest', + 'Remove-VerkadaCameraArchive', + 'Remove-VerkadaCameraLicensePlateOfInterest', + 'Remove-VerkadaCommandUser', 'Remove-VerkadaHelixEvent', 'Remove-VerkadaWorkplaceEmployee', 'Send-VerkadaPassInvite', 'Set-VerkadaAccessDoorName', 'Set-VerkadaAccessDoorScheduleOverride', @@ -115,12 +117,13 @@ FunctionsToExport = 'Add-VerkadaAccessGroup', 'Add-VerkadaAccessSiteAdmin', 'Set-VerkadaAccessUserRemoteUnlock', 'Set-VerkadaAccessUserStartDate', 'Set-VerkadaAlarmsDoorSensorSettings', - 'Set-VerkadaAlarmsPanicButtonSettings', 'Set-VerkadaCameraName', + 'Set-VerkadaAlarmsPanicButtonSettings', + 'Set-VerkadaCameraCloudBackupSettings', + 'Set-VerkadaCameraLicensePlateOfInterest', 'Set-VerkadaCameraName', 'Set-VerkadaCameraOrientation', 'Set-VerkadaCameraSite', 'Set-VerkadaCameraTamperSensitivity', - 'Set-VerkadaCloudBackupSettings', 'Set-VerkadaCommandPermissions', - 'Set-VerkadaCommandUser', 'Set-VerkadaHelixEvent', - 'Set-VerkadaLicensePlateOfInterest', 'Set-VerkadaSitePermissions', + 'Set-VerkadaCommandPermissions', 'Set-VerkadaCommandUser', + 'Set-VerkadaHelixEvent', 'Set-VerkadaSitePermissions', 'Set-VerkadaWorkplaceEmployee', 'Unlock-VerkadaAccessDoor' # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. @@ -132,9 +135,10 @@ CmdletsToExport = @() # Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. AliasesToExport = 'a-VrkdaAcGrp', 'Add-VrkdaAcGrp', 'a-VrkdaAcUsrCrd', 'Add-VrkdaAcUsrCrd', 'a-VrkdaAcUsrLPR', 'Add-VrkdaAcUsrLPR', - 'a-VrkdaAcUsrMfaCd', 'Add-VrkdaAcUsrMfaCd', 'a-VrkdaCmdUsr', - 'Add-VrkdaCmdUsr', 'a-VrkdaHlxEvt', 'Add-VrkdaHlxEvt', - 'Add-VerkadaLPoI', 'a-VrkdaWrkEmp', 'Add-VrkdaWrkEmp', + 'a-VrkdaAcUsrMfaCd', 'Add-VrkdaAcUsrMfaCd', 'a-VrkdaLPoI', + 'Add-VerkadaLicensePlateOfInterest', 'Add-VerkadaLPoI', + 'Add-VrkdaLPoI', 'a-VrkdaCmdUsr', 'Add-VrkdaCmdUsr', 'a-VrkdaHlxEvt', + 'Add-VrkdaHlxEvt', 'a-VrkdaWrkEmp', 'Add-VrkdaWrkEmp', 'd-VrkdaAcUsrCrd', 'Disable-VrkdaAcUsrCrd', 'd-VrkdaAcUsrLPR', 'Disable-VrkdaAcUsrLPR', 'e-VrkdaAcUsrCrd', 'Enable-VrkdaAcUsrCrd', 'e-VrkdaAcUsrLPR', 'Enable-VrkdaAcUsrLPR', 'fd-VrkdaHlxEvt', @@ -143,13 +147,15 @@ AliasesToExport = 'a-VrkdaAcGrp', 'Add-VrkdaAcGrp', 'a-VrkdaAcUsrCrd', 'ep-VrkdaAcUsrPrflPic', 'Export-VerkadaAccessUserProfilePicture', 'Export-VrkdaAcUsrPrflPic', 'g-VrkdaAcUsrPrflPic', 'Get-VrkdaAcUsrPrflPic', 'g-VrkdAlrmDevs', 'Get-VrkdAlrmDevs', - 'Get-VerkadaCameraSite', 'Get-VrkdaCmdUsr', 'gt-VrkdaCmdUsr', - 'g-VrkdaHlxEvt', 'Get-VrkdaHlxEvt', 'Get-VerkadaLPoI', - 'Get-VrkdaWrkEmp', 'gt-VrkdaWrkEmp', 'rd-VrkdaAcGrps', - 'Read-VrkdaAcGrps', 'rd-VrkdaCamArchv', 'Read-VrkdaCamArchv', - 'rd-VrkdaGstSte', 'Read-VrkdaGstSte', 'rd-VrkdaWrkEmp', - 'Read-VrkdaWrkEmp', 'Remove-VrkdaAcGrp', 'rm-VrkdaAcGrp', - 'Remove-VrkdaAcUsrBtUnlk', 'rm-VrkdaAcUsrBtUnlk', + 'Get-VerkadaCloudBackupSettings', 'Get-VrkdaCamCbStngs', + 'gt-VrkdaCamCbStngs', 'Get-VerkadaCameraSite', 'Get-VrkdaCams', + 'gt-VrkdaCams', 'rd-VrkdaCams', 'Read-VerkadaCameras', 'Read-VrkdaCams', + 'Get-VrkdaCmdUsr', 'gt-VrkdaCmdUsr', 'g-VrkdaHlxEvt', 'Get-VrkdaHlxEvt', + 'Get-VerkadaLPoI', 'Get-VrkdaWrkEmp', 'gt-VrkdaWrkEmp', + 'rd-VrkdaAcGrps', 'Read-VrkdaAcGrps', 'rd-VrkdaCamArchv', + 'Read-VrkdaCamArchv', 'rd-VrkdaGstSte', 'Read-VrkdaGstSte', + 'rd-VrkdaWrkEmp', 'Read-VrkdaWrkEmp', 'Remove-VrkdaAcGrp', + 'rm-VrkdaAcGrp', 'Remove-VrkdaAcUsrBtUnlk', 'rm-VrkdaAcUsrBtUnlk', 'Remove-VrkdaAcUsrCrd', 'rm-VrkdaAcUsrCrd', 'Remove-VrkdaAcUsrEntryCo', 'rm-VrkdaAcUsrEntryCo', 'Remove-VrkdaAcUsrFrGrp', 'rm-VrkdaAcUsrFrGrp', @@ -157,21 +163,25 @@ AliasesToExport = 'a-VrkdaAcGrp', 'Add-VrkdaAcGrp', 'a-VrkdaAcUsrCrd', 'rm-VrkdaAcUsrMfaCd', 'Remove-VrkdaAcUsrPrflPic', 'rm-VrkdaAcUsrPrflPic', 'Remove-VrkdaAcUsrRmtUnlk', 'rm-VrkdaAcUsrRmtUnlk', 'Remove-VrkdaCamArchv', 'rm-VrkdaCamArchv', - 'Remove-VrkdaCmdUsr', 'rm-VrkdaCmdUsr', 'Remove-VrkdaHlxEvt', - 'rm-VrkdaHlxEvt', 'Remove-VerkadaLPoI', 'Remove-VrkdaWrkEmp', - 'rm-VrkdaWrkEmp', 'sd-VrkdaPssInv', 'Send-VrkdaPssInv', - 'Set-VrkdaAcDrNm', 'st-VrkdaAcDrNm', 's-VrkdAcDrSchOvrd', - 'Set-VrkdAcDrSchOvrd', 'Set-VrkdaAcUsrBtUnlk', 'st-VrkdaAcUsrBtUnlk', - 'Set-VrkdaAcUsrEndDt', 'st-VrkdaAcUsrEndDt', 'Set-VrkdaAcUsrEntryCo', - 'st-VrkdaAcUsrEntryCo', 'Set-VrkdaAcUsrGrp', 'st-VrkdaAcUsrGrp', - 's-VrkdaAcUsrPrflPic', 'Set-VrkdaAcUsrPrflPic', + 'Remove-VerkadaLicensePlateOfInterest', 'Remove-VerkadaLPoI', + 'Remove-VrkdaLPoI', 'rm-VrkdaLPoI', 'Remove-VrkdaCmdUsr', + 'rm-VrkdaCmdUsr', 'Remove-VrkdaHlxEvt', 'rm-VrkdaHlxEvt', + 'Remove-VrkdaWrkEmp', 'rm-VrkdaWrkEmp', 'sd-VrkdaPssInv', + 'Send-VrkdaPssInv', 'Set-VrkdaAcDrNm', 'st-VrkdaAcDrNm', + 's-VrkdAcDrSchOvrd', 'Set-VrkdAcDrSchOvrd', 'Set-VrkdaAcUsrBtUnlk', + 'st-VrkdaAcUsrBtUnlk', 'Set-VrkdaAcUsrEndDt', 'st-VrkdaAcUsrEndDt', + 'Set-VrkdaAcUsrEntryCo', 'st-VrkdaAcUsrEntryCo', 'Set-VrkdaAcUsrGrp', + 'st-VrkdaAcUsrGrp', 's-VrkdaAcUsrPrflPic', 'Set-VrkdaAcUsrPrflPic', 'Set-VrkdaAcUsrRmtUnlk', 'st-VrkdaAcUsrRmtUnlk', 'Set-VrkdaAcUsrStrtDt', 'st-VrkdaAcUsrStrtDt', 's-VrkdAlrmBr31Setgs', 's-VrkdAlrmDrSenSetgs', 'Set-VrkdAlrmDrSenSetgs', 's-VrkdAlrmBr33Setgs', 's-VrkdAlrmPancSetgs', 'Set-VrkdAlrmPancSetgs', - 'Set-VrkdaCamOrnt', 'VrkdaCamOrnt', 'Set-VrkdaCamTmprSen', - 'VrkdaCamTmprSen', 'Set-VrkdaCmdUsr', 'st-VrkdaCmdUsr', - 'Set-VrkdaHlxEvt', 'st-VrkdaHlxEvt', 'Set-VerkadaLPoI', + 's-VrkdaCamCbStngs', 'Set-VerkadaCloudBackupSettings', + 'Set-VrkdaCamCbStngs', 's-VrkdaLPoI', + 'Set-VerkadaLicensePlateOfInterest', 'Set-VerkadaLPoI', + 'Set-VrkdaLPoI', 'Set-VrkdaCamOrnt', 'VrkdaCamOrnt', + 'Set-VrkdaCamTmprSen', 'VrkdaCamTmprSen', 'Set-VrkdaCmdUsr', + 'st-VrkdaCmdUsr', 'Set-VrkdaHlxEvt', 'st-VrkdaHlxEvt', 'Set-VrkdaWrkEmp', 'st-VrkdaWrkEmp', 'uk-VrkdAcDoor', 'Unlock-VrkdAcDoor' From ba619cd6a0f0fcfafd54a22c64d95b04c29c7909 Mon Sep 17 00:00:00 2001 From: bepsoccer <26012546+bepsoccer@users.noreply.github.com> Date: Fri, 24 Oct 2025 01:36:53 +0000 Subject: [PATCH 3/3] Bumping release to 0.10.0 --- .../Add-VerkadaAccessGroup.md | 31 +-- .../Add-VerkadaAccessUserCard.md | 38 +-- .../Add-VerkadaAccessUserLicensePlate.md | 32 +-- .../Add-VerkadaAccessUserMfaCode.md | 31 +-- ...Add-VerkadaCameraLicensePlateOfInterest.md | 155 ++++++++++++ .../Add-VerkadaCommandUser.md | 37 +-- .../Add-VerkadaHelixEvent.md | 46 ++-- .../function-documentation/Connect-Verkada.md | 38 +-- .../Disable-VerkadaAccessUserCard.md | 31 +-- .../Disable-VerkadaAccessUserLicensePlate.md | 31 +-- .../Disconnect-Verkada.md | 17 +- .../Enable-VerkadaAccessUserCard.md | 31 +-- .../Enable-VerkadaAccessUserLicensePlate.md | 31 +-- .../Find-VerkadaHelixEvent.md | 51 ++-- .../Get-VerkadaAccessEvents.md | 47 ++-- .../Get-VerkadaAccessGroup.md | 33 +-- .../Get-VerkadaAccessUser.md | 32 +-- .../Get-VerkadaAccessUserProfilePicture.md | 31 +-- .../Get-VerkadaCameraCloudBackupSettings.md | 149 +++++++++++ .../Get-VerkadaCameras.md | 58 ++--- .../Get-VerkadaCommandUser.md | 32 +-- .../Get-VerkadaHelixEvent.md | 41 +-- .../Get-VerkadaLicensePlatesOfInterest.md | 30 +-- .../Invoke-VerkadaFormCall.md | 8 +- .../Invoke-VerkadaRestMethod.md | 20 +- .../Read-VerkadaAccessGroups.md | 31 +-- .../Read-VerkadaAccessUsers.md | 33 +-- .../Read-VerkadaGuestSites.md | 29 +-- .../Remove-VerkadaAccessGroup.md | 31 +-- .../Remove-VerkadaAccessUserBleUnlock.md | 29 +-- .../Remove-VerkadaAccessUserCard.md | 31 +-- .../Remove-VerkadaAccessUserEntryCode.md | 29 +-- .../Remove-VerkadaAccessUserFromGroup.md | 31 +-- .../Remove-VerkadaAccessUserLicensePlate.md | 31 +-- .../Remove-VerkadaAccessUserMfaCode.md | 31 +-- .../Remove-VerkadaAccessUserProfilePicture.md | 29 +-- .../Remove-VerkadaAccessUserRemoteUnlock.md | 29 +-- ...ove-VerkadaCameraLicensePlateOfInterest.md | 139 +++++++++++ .../Remove-VerkadaCommandUser.md | 32 +-- .../Remove-VerkadaHelixEvent.md | 41 +-- .../Send-VerkadaPassInvite.md | 31 +-- .../Set-VerkadaAccessUserBleUnlock.md | 33 +-- .../Set-VerkadaAccessUserEndDate.md | 31 +-- .../Set-VerkadaAccessUserEntryCode.md | 29 +-- .../Set-VerkadaAccessUserGroup.md | 29 +-- .../Set-VerkadaAccessUserProfilePicture.md | 31 +-- .../Set-VerkadaAccessUserRemoteUnlock.md | 29 +-- .../Set-VerkadaAccessUserStartDate.md | 31 +-- .../Set-VerkadaCameraCloudBackupSettings.md | 233 ++++++++++++++++++ ...Set-VerkadaCameraLicensePlateOfInterest.md | 155 ++++++++++++ .../Set-VerkadaCommandUser.md | 37 +-- .../Set-VerkadaHelixEvent.md | 46 ++-- docs/reference.md | 10 +- verkadaModule/verkadaModule.psd1 | 4 +- 54 files changed, 1290 insertions(+), 1096 deletions(-) create mode 100644 docs/function-documentation/Add-VerkadaCameraLicensePlateOfInterest.md create mode 100644 docs/function-documentation/Get-VerkadaCameraCloudBackupSettings.md create mode 100644 docs/function-documentation/Remove-VerkadaCameraLicensePlateOfInterest.md create mode 100644 docs/function-documentation/Set-VerkadaCameraCloudBackupSettings.md create mode 100644 docs/function-documentation/Set-VerkadaCameraLicensePlateOfInterest.md diff --git a/docs/function-documentation/Add-VerkadaAccessGroup.md b/docs/function-documentation/Add-VerkadaAccessGroup.md index a7d9f26..9156517 100644 --- a/docs/function-documentation/Add-VerkadaAccessGroup.md +++ b/docs/function-documentation/Add-VerkadaAccessGroup.md @@ -13,28 +13,28 @@ Creates an Access group in an organization using https://apidocs.verkada.com/ref ## SYNTAX ``` -Add-VerkadaAccessGroup [[-name] ] [[-org_id] ] [[-x_verkada_auth_api] ] - [[-region] ] [-errorsToFile] [-ProgressAction ] [] +Add-VerkadaAccessGroup [[-name] ] [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] + [-ProgressAction ] [] ``` ## DESCRIPTION Create an access group within the given organization using the given name. The name of the access group must be unique within the organization. This returns the Access Group Metadata Object for the created Access Group. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Add-VerkadaAccessGroup -name 'Newgroup' -This will add the access group with the name "NewGroup". The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will add the access group with the name "NewGroup". The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` -Add-VerkadaAccessGroup -name 'NewGroup' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This will add the access group with the name "NewGroup". The org_id and tokens are submitted as parameters in the call. +Add-VerkadaAccessGroup -name 'NewGroup' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This will add the access group with the name "NewGroup". The token is submitted as a parameter in the call. ``` ## PARAMETERS @@ -54,21 +54,6 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -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 @@ -78,7 +63,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 3 +Position: 2 Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: False Accept wildcard characters: False @@ -93,7 +78,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 4 +Position: 3 Default value: Api Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/function-documentation/Add-VerkadaAccessUserCard.md b/docs/function-documentation/Add-VerkadaAccessUserCard.md index 670376b..b613ba9 100644 --- a/docs/function-documentation/Add-VerkadaAccessUserCard.md +++ b/docs/function-documentation/Add-VerkadaAccessUserCard.md @@ -15,23 +15,22 @@ Creates and adds an Access credential to an Access user in an organization using ### cardNumber (Default) ``` Add-VerkadaAccessUserCard [-userId ] [-externalId ] -cardType -cardNumber - [-facilityCode ] [-active ] [-org_id ] [-x_verkada_auth_api ] - [-region ] [-errorsToFile] [-ProgressAction ] [] + [-facilityCode ] [-active ] [-x_verkada_auth_api ] [-region ] [-errorsToFile] + [-ProgressAction ] [] ``` ### cardNumberHex ``` Add-VerkadaAccessUserCard [-userId ] [-externalId ] -cardType -cardNumberHex - [-facilityCode ] [-active ] [-org_id ] [-x_verkada_auth_api ] - [-region ] [-errorsToFile] [-ProgressAction ] [] + [-facilityCode ] [-active ] [-x_verkada_auth_api ] [-region ] [-errorsToFile] + [-ProgressAction ] [] ``` ### cardNumberBase36 ``` Add-VerkadaAccessUserCard [-userId ] [-externalId ] -cardType - -cardNumberBase36 [-facilityCode ] [-active ] [-org_id ] - [-x_verkada_auth_api ] [-region ] [-errorsToFile] [-ProgressAction ] - [] + -cardNumberBase36 [-facilityCode ] [-active ] [-x_verkada_auth_api ] + [-region ] [-errorsToFile] [-ProgressAction ] [] ``` ## DESCRIPTION @@ -39,26 +38,26 @@ Create and add an access card for a specified user_id or external_id and org_id. Card object will be passed in the body of the request as a json. We require facility code and card number OR card_number_hex OR card_number_base36. The successful repsonse will be the created credential information. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Add-VerkadaAccessUserCard -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -type 'HID' -facilityCode 111 -cardNumber 55555 -This will add a badge in the HID format with facility code 111 and card number 55555 to the user specified. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will add a badge in the HID format with facility code 111 and card number 55555 to the user specified. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` -Add-VerkadaAccessUserCard -externalId 'newUserUPN@contoso.com' -type 'HID' -facilityCode 111 -cardNumber 55555 -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This will add an Access credential in the HID format with facility code 111 and card number 55555 to the user specified. The org_id and tokens are submitted as parameters in the call. +Add-VerkadaAccessUserCard -externalId 'newUserUPN@contoso.com' -type 'HID' -facilityCode 111 -cardNumber 55555 -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This will add an Access credential in the HID format with facility code 111 and card number 55555 to the user specified. The token is submitted as a parameter in the call. ``` ### EXAMPLE 3 ``` Import-Csv ./myUserBadges.csv | Add-VerkadaAccessUserCard -This will add an Access credential for every row in the csv file which contains userId, type, cardNumber(or cardNumberHex or cardNumberBase36), and facilityCode(optional). The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will add an Access credential for every row in the csv file which contains userId, type, cardNumber(or cardNumberHex or cardNumberBase36), and facilityCode(optional). The token will be populated from the cache created by Connect-Verkada. ``` ## PARAMETERS @@ -184,21 +183,6 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -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 diff --git a/docs/function-documentation/Add-VerkadaAccessUserLicensePlate.md b/docs/function-documentation/Add-VerkadaAccessUserLicensePlate.md index a138baa..d9a3ea5 100644 --- a/docs/function-documentation/Add-VerkadaAccessUserLicensePlate.md +++ b/docs/function-documentation/Add-VerkadaAccessUserLicensePlate.md @@ -14,9 +14,8 @@ Adds a license plate credential to an Aceess user in an organization using https ``` Add-VerkadaAccessUserLicensePlate [[-userId] ] [[-externalId] ] - [[-licensePlateNumber] ] [[-name] ] [[-active] ] [[-org_id] ] - [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] [-ProgressAction ] - [] + [[-licensePlateNumber] ] [[-name] ] [[-active] ] [[-x_verkada_auth_api] ] + [[-region] ] [-errorsToFile] [-ProgressAction ] [] ``` ## DESCRIPTION @@ -24,20 +23,20 @@ Add a license plate credential to a user given a specified user_id or external_i License plate object will be passed in the body of the request as a json. We require a string of 6 alphanumeric values. The License Plate Object is returned. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Add-VerkadaAccessUserLicensePlate -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -licensePlateNumber 'ABC123' -This will add the license plate ABC123 to the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 as a credential. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will add the license plate ABC123 to the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 as a credential. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` -Add-VerkadaAccessUserLicensePlate -externalId 'newUserUPN@contoso.com' -licensePlateNumber 'ABC123' -name 'Users License Plate' -active $true -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_token 'a366ef47-2c20-4d35-a90a-10fd2aee113a' -This will add the license plate ABC123 to the Access user with externalId newUserUPN@contoso.com as a credential and mark it active. The org_id and tokens are submitted as parameters in the call. +Add-VerkadaAccessUserLicensePlate -externalId 'newUserUPN@contoso.com' -licensePlateNumber 'ABC123' -name 'Users License Plate' -active $true -x_verkada_token 'a366ef47-2c20-4d35-a90a-10fd2aee113a' +This will add the license plate ABC123 to the Access user with externalId newUserUPN@contoso.com as a credential and mark it active. The token is submitted as a parameter in the call. ``` ## PARAMETERS @@ -118,21 +117,6 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 6 -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -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 @@ -142,7 +126,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 7 +Position: 6 Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: False Accept wildcard characters: False @@ -157,7 +141,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 8 +Position: 7 Default value: Api Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/function-documentation/Add-VerkadaAccessUserMfaCode.md b/docs/function-documentation/Add-VerkadaAccessUserMfaCode.md index f2db774..8977648 100644 --- a/docs/function-documentation/Add-VerkadaAccessUserMfaCode.md +++ b/docs/function-documentation/Add-VerkadaAccessUserMfaCode.md @@ -14,27 +14,27 @@ Adds a mfa code credential to a user using https://apidocs.verkada.com/reference ``` Add-VerkadaAccessUserMfaCode [[-userId] ] [[-externalId] ] [[-mfaCode] ] - [[-org_id] ] [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] - [-ProgressAction ] [] + [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] [-ProgressAction ] + [] ``` ## DESCRIPTION Adds a mfa code credential to a user given a specified user_id or external_id and org_id. MFA code object will be passed in the body of the request as a json. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Add-VerkadaAccessUserMfaCode -mfaCode '9567' -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -This adds the MFA code 9567 to the Access user's profile with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The org_id and token will be populated from the cached created by Connect-Verkada. +This adds the MFA code 9567 to the Access user's profile with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` -Add-VerkadaAccessUserMfaCode -mfaCode '9567' -externalId 'newUserUPN@contoso.com' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This adds the MFA code 9567 to the Access user's profile with externalId newUserUPN@contoso.com. The org_id and token are submitted as parameters in the call. +Add-VerkadaAccessUserMfaCode -mfaCode '9567' -externalId 'newUserUPN@contoso.com' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This adds the MFA code 9567 to the Access user's profile with externalId newUserUPN@contoso.com. The token is submitted as a parameter in the call. ``` ## PARAMETERS @@ -84,21 +84,6 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 4 -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -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 @@ -108,7 +93,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 5 +Position: 4 Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: False Accept wildcard characters: False @@ -123,7 +108,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 6 +Position: 5 Default value: Api Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/function-documentation/Add-VerkadaCameraLicensePlateOfInterest.md b/docs/function-documentation/Add-VerkadaCameraLicensePlateOfInterest.md new file mode 100644 index 0000000..c4a7e69 --- /dev/null +++ b/docs/function-documentation/Add-VerkadaCameraLicensePlateOfInterest.md @@ -0,0 +1,155 @@ +--- +external help file: verkadaModule-help.xml +Module Name: verkadaModule +online version: https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Add-VerkadaCameraLicensePlateOfInterest.md +schema: 2.0.0 +--- + +# Add-VerkadaCameraLicensePlateOfInterest + +## SYNOPSIS +Creates a License Plate of Interest for an organization using a specified description and license plate number using https://apidocs.verkada.com/reference/postlicenseplateofinterestviewv1 + +## SYNTAX + +``` +Add-VerkadaCameraLicensePlateOfInterest [-license_plate] [-description] + [-x_verkada_auth_api ] [-region ] [-errorsToFile] [-ProgressAction ] + [] +``` + +## DESCRIPTION +Creates a License Plate of Interest for an organization using a specified description and license plate number. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. + +## EXAMPLES + +### EXAMPLE 1 +``` +Add-VerkadaCameraLicensePlateOfInterest -license_plate 'ABC123' -description 'New License Plate' +The token will be populated from the cache created by Connect-Verkada. +``` + +### EXAMPLE 2 +``` +Add-VerkadaLPoI 'ABC123' 'New License Plate' +The token will be populated from the cache created by Connect-Verkada. +``` + +### EXAMPLE 3 +``` +Import-CSV ./file_ofLicenses_and_Descriptions.csv | Add-VerkadaLPoI +The token will be populated from the cache created by Connect-Verkada. +``` + +### EXAMPLE 4 +``` +Add-VerkadaCameraLicensePlateOfInterest -license_plate 'ABC123' -description 'New License Plate' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +The token is submitted as a parameter in the call. +``` + +## PARAMETERS + +### -license_plate +The license plate number of the License Plate of Interest + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -description +The description for the License Plate of Interest + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: True (ByPropertyName) +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: (All) +Aliases: + +Required: False +Position: Named +Default value: $Global:verkadaConnection.x_verkada_auth_api +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -region +The region of the public API to be used + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: Api +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -errorsToFile +Switch to write errors to file + +```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 + +[https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Add-VerkadaCameraLicensePlateOfInterest.md](https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Add-VerkadaCameraLicensePlateOfInterest.md) + diff --git a/docs/function-documentation/Add-VerkadaCommandUser.md b/docs/function-documentation/Add-VerkadaCommandUser.md index da90909..bb741e6 100644 --- a/docs/function-documentation/Add-VerkadaCommandUser.md +++ b/docs/function-documentation/Add-VerkadaCommandUser.md @@ -16,7 +16,7 @@ Adds a user to Verkada Command using https://apidocs.verkada.com/reference/postu Add-VerkadaCommandUser [[-email] ] [[-firstName] ] [[-middleName] ] [[-lastName] ] [[-externalId] ] [[-companyName] ] [[-department] ] [[-departmentId] ] [[-employeeId] ] [[-employeeType] ] [[-employeeTitle] ] - [[-phone] ] [[-org_id] ] [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] + [[-phone] ] [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] [-ProgressAction ] [] ``` @@ -24,44 +24,44 @@ Add-VerkadaCommandUser [[-email] ] [[-firstName] ] [[-middleName Creates a user in an organization. External ID required. Otherwise, the newly created user will contain a user ID which can be used for identification. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Add-VerkadaCommandUser -firstName 'New' -lastName 'User' -This will add the Command user with the name "New User". The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will add the Command user with the name "New User". The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` -Add-VerkadaCommandUser -firstName 'New' -lastName 'User' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This will add the Command user with the name "New User". The org_id and tokens are submitted as parameters in the call. +Add-VerkadaCommandUser -firstName 'New' -lastName 'User' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This will add the Command user with the name "New User". The token is submitted as a parameter in the call. ``` ### EXAMPLE 3 ``` Add-VerkadaCommandUser -firstName 'New' -lastName 'User' -email 'newUser@contoso.com' -This will add the Command user with the name "New User" and email newUser@contoso.com. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will add the Command user with the name "New User" and email newUser@contoso.com. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 4 ``` Add-VerkadaCommandUser -firstName 'New' -lastName 'User' -email 'newUser@contoso.com' -externalId 'newUserUPN@contoso.com' -This will add the Command user with the name "New User", email newUser@contoso.com, and externalId newUserUPN@contoso.com. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will add the Command user with the name "New User", email newUser@contoso.com, and externalId newUserUPN@contoso.com. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 5 ``` Add-VerkadaCommandUser -email 'newUser@contoso.com' -This will add the Command user with the email newUser@contoso.com. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will add the Command user with the email newUser@contoso.com. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 6 ``` Add-VerkadaCommandUser -firstName 'New' -lastName 'User' -email 'newUser@contoso.com -companyName 'Contoso' -department 'sales' -departmentId 'US-Sales' -employeeId '12345' -employeeTitle 'The Closer' -employeeType 'Full Time' -phone '+18165556789' -This will add the Command user with the name "New User" and email newUser@contoso.com in department defined as sales with departmnetId of US-Sales with the appropriate companyName, employeeID, employeeTitle, employeeType and phone. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will add the Command user with the name "New User" and email newUser@contoso.com in department defined as sales with departmnetId of US-Sales with the appropriate companyName, employeeID, employeeTitle, employeeType and phone. The token will be populated from the cache created by Connect-Verkada. ``` ## PARAMETERS @@ -247,21 +247,6 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 13 -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -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 @@ -271,7 +256,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 14 +Position: 13 Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: False Accept wildcard characters: False @@ -286,7 +271,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 15 +Position: 14 Default value: Api Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/function-documentation/Add-VerkadaHelixEvent.md b/docs/function-documentation/Add-VerkadaHelixEvent.md index 00db863..db0b694 100644 --- a/docs/function-documentation/Add-VerkadaHelixEvent.md +++ b/docs/function-documentation/Add-VerkadaHelixEvent.md @@ -13,49 +13,33 @@ Creates a Helix event in Commadn using https://apidocs.verkada.com/reference/pos ## SYNTAX ``` -Add-VerkadaHelixEvent [[-org_id] ] [-camera_id] [-event_type_uid] - [[-timeStamp] ] [[-epoch_time] ] [-attributes] [[-flagged] ] - [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] [-ProgressAction ] - [] +Add-VerkadaHelixEvent [-camera_id] [-event_type_uid] [[-timeStamp] ] + [[-epoch_time] ] [-attributes] [[-flagged] ] [[-x_verkada_auth_api] ] + [[-region] ] [-errorsToFile] [-ProgressAction ] [] ``` ## DESCRIPTION This method can be used to generate a Helix Event in Command. Users will be able to specify the attribute values for each attribute key that was previously defined in the Event Type creation process. To successfully create a Helix Event, users will need to input the associated Camera ID, API Token with Helix permissions, Event Type UID, and the exact event epoch timestamp in milliseconds. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Add-VerkadaHelixEvent -camera_id 6b8731d7-d991-4206-ba71-b5446fa617fc -event_type_uid cf918b16-26cd-4c01-a672-5a91b79311e1 -timeStamp (get-date) -attributes $attributes -This will add a new helix event for the current time for the sepcified camera, event ID, and submitted attributes. The org_id and token will be populated from the cached created by Connect-Verkada. +This will add a new helix event for the current time for the sepcified camera, event ID, and submitted attributes. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` -Add-VerkadaHelixEvent -camera_id 6b8731d7-d991-4206-ba71-b5446fa617fc -event_type_uid cf918b16-26cd-4c01-a672-5a91b79311e1 -timeStamp '1/1/2025 08:35:00 -06' -attributes $attributes -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This will add a new helix event for Jan 1, 2025 at 8:35 AM CST for the sepcified camera, event ID, and submitted attributes. The org_id and token are submitted as parameters in the call. +Add-VerkadaHelixEvent -camera_id 6b8731d7-d991-4206-ba71-b5446fa617fc -event_type_uid cf918b16-26cd-4c01-a672-5a91b79311e1 -timeStamp '1/1/2025 08:35:00 -06' -attributes $attributes -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This will add a new helix event for Jan 1, 2025 at 8:35 AM CST for the sepcified camera, event ID, and submitted attributes. The token is submitted as a parameter in the call. ``` ## PARAMETERS -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 1 -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - ### -camera_id The UUID of the camera who's name is being changed @@ -65,7 +49,7 @@ Parameter Sets: (All) Aliases: cameraId Required: True -Position: 2 +Position: 1 Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False @@ -80,7 +64,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 3 +Position: 2 Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False @@ -95,7 +79,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 4 +Position: 3 Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False @@ -110,7 +94,7 @@ Parameter Sets: (All) Aliases: time_ms Required: False -Position: 5 +Position: 4 Default value: 0 Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False @@ -125,7 +109,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 6 +Position: 5 Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False @@ -140,7 +124,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 7 +Position: 6 Default value: False Accept pipeline input: False Accept wildcard characters: False @@ -155,7 +139,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 8 +Position: 7 Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: False Accept wildcard characters: False @@ -170,7 +154,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 9 +Position: 8 Default value: Api Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/function-documentation/Connect-Verkada.md b/docs/function-documentation/Connect-Verkada.md index 8453da5..31db14f 100644 --- a/docs/function-documentation/Connect-Verkada.md +++ b/docs/function-documentation/Connect-Verkada.md @@ -14,19 +14,19 @@ Gathers needed credentials for Verkada's API Endpoints ### apiToken (Default) ``` -Connect-Verkada [-org_id] [-x_api_key] [-region ] [-noOutput] - [-ProgressAction ] [] +Connect-Verkada -x_api_key [-region ] [-noOutput] [-ProgressAction ] + [] ``` ### ManualTokens ``` -Connect-Verkada [-org_id] [[-x_api_key] ] [-region ] [-userToken] - [-csrfToken] [-usr] [-manual] [-ProgressAction ] [] +Connect-Verkada -org_id [-x_api_key ] [-region ] -userToken + -csrfToken -usr [-manual] [-ProgressAction ] [] ``` ### UnPwd ``` -Connect-Verkada [-org_id] [[-x_api_key] ] [-region ] -userName [-Password] +Connect-Verkada -org_id [-x_api_key ] [-region ] -userName [-Password] [-MyPwd ] [-otp ] [-ProgressAction ] [] ``` @@ -37,31 +37,31 @@ This function is used to authenticate a session and store the needed tokens and ### EXAMPLE 1 ``` -Connect-Verkada '7cd47706-f51b-4419-8675-3b9f0ce7c12d' 'myapiKey-dcwdskjnlnlkj' +Connect-Verkada -x_api_key 'myapiKey-dcwdskjnlnlkj' This will store the org_id 7cd47706-f51b-4419-8675-3b9f0ce7c12d with the public API key myapiKey-dcwdskjnlnlkj. ``` ### EXAMPLE 2 ``` -Connect-Verkada '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -userName "admin.user@contoso.com" -otp (Get-Otp (Get-Secret -Name myVerkadaOtp -AsPlainText)) -MyPwd (Get-Secret -Name myVerkadaPassword) -x_api_key 'myapiKey-dcwdskjnlnlkj' +Connect-Verkada -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -userName "admin.user@contoso.com" -otp (Get-Otp (Get-Secret -Name myVerkadaOtp -AsPlainText)) -MyPwd (Get-Secret -Name myVerkadaPassword) -x_api_key 'myapiKey-dcwdskjnlnlkj' This will authenticate user admin.user@contoso.com with a otp token and a secure string variable stored password([secureString]$yourPwd) and upon success store the org_id 7cd47706-f51b-4419-8675-3b9f0ce7c12d and the returned tokens. This will also store the org_id 7cd47706-f51b-4419-8675-3b9f0ce7c12d with the public API key myapiKey-dcwdskjnlnlkj ``` ### EXAMPLE 3 ``` -Connect-Verkada '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -userName "admin.user@contoso.com" -Password +Connect-Verkada -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -userName "admin.user@contoso.com" -Password This will authenticate user admin.user@contoso.com by prompting for the password(stored as a secure string) and upon success store the org_id 7cd47706-f51b-4419-8675-3b9f0ce7c12d and the returned tokens. This will no longer work for OrgAdmins due to the MFA requirement. ``` ### EXAMPLE 4 ``` -Connect-Verkada '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -userName "admin.user@contoso.com" -otp '123456' -MyPwd $yourPwd(seure string) +Connect-Verkada -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -userName "admin.user@contoso.com" -otp '123456' -MyPwd $yourPwd(seure string) This will authenticate user admin.user@contoso.com with a otp token and a secure string variable stored password([secureString]$yourPwd) and upon success store the org_id 7cd47706-f51b-4419-8675-3b9f0ce7c12d and the returned tokens. This will no longer work for OrgAdmins due to the MFA requirement. ``` ### EXAMPLE 5 ``` -Connect-Verkada '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'myapiKey-dcwdskjnlnlkj' -userName "admin.user@contoso.com" -Password +Connect-Verkada -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'myapiKey-dcwdskjnlnlkj' -userName "admin.user@contoso.com" -Password This will store the org_id 7cd47706-f51b-4419-8675-3b9f0ce7c12d with the public API key myapiKey-dcwdskjnlnlkj and will authenticate user admin.user@contoso.com by prompting for the password(stored as a secure string) and storing the returned tokens. This will no longer work for OrgAdmins due to the MFA requirement. ``` @@ -72,11 +72,11 @@ The UUID of the organization the user belongs to ```yaml Type: String -Parameter Sets: apiToken, ManualTokens +Parameter Sets: ManualTokens Aliases: Required: True -Position: 1 +Position: Named Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False @@ -88,7 +88,7 @@ Parameter Sets: UnPwd Aliases: Required: True -Position: 1 +Position: Named Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False @@ -103,7 +103,7 @@ Parameter Sets: apiToken Aliases: token Required: True -Position: 2 +Position: Named Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False @@ -115,7 +115,7 @@ Parameter Sets: ManualTokens Aliases: token Required: False -Position: 2 +Position: Named Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False @@ -127,7 +127,7 @@ Parameter Sets: UnPwd Aliases: token Required: False -Position: 2 +Position: Named Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False @@ -202,7 +202,7 @@ Parameter Sets: ManualTokens Aliases: x_verkada_auth Required: True -Position: 3 +Position: Named Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False @@ -217,7 +217,7 @@ Parameter Sets: ManualTokens Aliases: x_verkada_token Required: True -Position: 4 +Position: Named Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False @@ -232,7 +232,7 @@ Parameter Sets: ManualTokens Aliases: x-verkada-user-id Required: True -Position: 5 +Position: Named Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False diff --git a/docs/function-documentation/Disable-VerkadaAccessUserCard.md b/docs/function-documentation/Disable-VerkadaAccessUserCard.md index bcdccf3..4a61e3e 100644 --- a/docs/function-documentation/Disable-VerkadaAccessUserCard.md +++ b/docs/function-documentation/Disable-VerkadaAccessUserCard.md @@ -14,27 +14,27 @@ Deactivates a credential for an Aceess user in an organization using https://api ``` Disable-VerkadaAccessUserCard [[-userId] ] [[-externalId] ] [[-cardId] ] - [[-org_id] ] [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] - [-ProgressAction ] [] + [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] [-ProgressAction ] + [] ``` ## DESCRIPTION Given the Verkada defined User ID (OR user defined External ID)and Card ID, deactivate a specific access card for a user. Returns the updated Access Card Object. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Disable-VerkadaAccessUserCard -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -cardId '10110010000000000000001011' -This will deactivate the credential with cardId 10110010000000000000001011 for the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 as a credential. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will deactivate the credential with cardId 10110010000000000000001011 for the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 as a credential. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` -Disable-VerkadaAccessUserCard -externalId 'newUserUPN@contoso.com' -cardId '10110010000000000000001011' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This will deactivate the credential with cardId 10110010000000000000001011 for the Access user with externalId newUserUPN@contoso.com as a credential. The org_id and tokens are submitted as parameters in the call. +Disable-VerkadaAccessUserCard -externalId 'newUserUPN@contoso.com' -cardId '10110010000000000000001011' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This will deactivate the credential with cardId 10110010000000000000001011 for the Access user with externalId newUserUPN@contoso.com as a credential. The token is submitted as a parameter in the call. ``` ## PARAMETERS @@ -84,21 +84,6 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 4 -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -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 @@ -108,7 +93,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 5 +Position: 4 Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: False Accept wildcard characters: False @@ -123,7 +108,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 6 +Position: 5 Default value: Api Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/function-documentation/Disable-VerkadaAccessUserLicensePlate.md b/docs/function-documentation/Disable-VerkadaAccessUserLicensePlate.md index 2734682..f7d53e4 100644 --- a/docs/function-documentation/Disable-VerkadaAccessUserLicensePlate.md +++ b/docs/function-documentation/Disable-VerkadaAccessUserLicensePlate.md @@ -14,27 +14,27 @@ Deactivates a license plate credential for an Aceess user in an organization usi ``` Disable-VerkadaAccessUserLicensePlate [[-userId] ] [[-externalId] ] - [[-licensePlateNumber] ] [[-org_id] ] [[-x_verkada_auth_api] ] [[-region] ] - [-errorsToFile] [-ProgressAction ] [] + [[-licensePlateNumber] ] [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] + [-ProgressAction ] [] ``` ## DESCRIPTION Given the Verkada defined User ID (OR user defined External ID)and License Plate Number, deactivate a users License Plate Credential. Returns the updated License Plate Object. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Disable-VerkadaAccessUserLicensePlate -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -licensePlateNumber 'ABC123' -This will deactivate the license plate ABC123 for the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 as a credential. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will deactivate the license plate ABC123 for the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 as a credential. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` -Disable-VerkadaAccessUserLicensePlate -externalId 'newUserUPN@contoso.com' -licensePlateNumber 'ABC123' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This will deactivate the license plate ABC123 for the Access user with externalId newUserUPN@contoso.com as a credential. The org_id and tokens are submitted as parameters in the call. +Disable-VerkadaAccessUserLicensePlate -externalId 'newUserUPN@contoso.com' -licensePlateNumber 'ABC123' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This will deactivate the license plate ABC123 for the Access user with externalId newUserUPN@contoso.com as a credential. The token is submitted as a parameter in the call. ``` ## PARAMETERS @@ -84,21 +84,6 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 4 -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -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 @@ -108,7 +93,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 5 +Position: 4 Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: False Accept wildcard characters: False @@ -123,7 +108,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 6 +Position: 5 Default value: Api Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/function-documentation/Disconnect-Verkada.md b/docs/function-documentation/Disconnect-Verkada.md index aee6da2..72bebff 100644 --- a/docs/function-documentation/Disconnect-Verkada.md +++ b/docs/function-documentation/Disconnect-Verkada.md @@ -13,7 +13,7 @@ Removes cached credentials for Verkada's API Enpoints ## SYNTAX ``` -Disconnect-Verkada [[-org_id] ] [-ProgressAction ] [] +Disconnect-Verkada [-ProgressAction ] [] ``` ## DESCRIPTION @@ -28,21 +28,6 @@ Disconnect-Verkada ## PARAMETERS -### -org_id -The UUID of the organization the user belongs to(not implemented) - -```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 }} diff --git a/docs/function-documentation/Enable-VerkadaAccessUserCard.md b/docs/function-documentation/Enable-VerkadaAccessUserCard.md index 0c02e92..1847d2c 100644 --- a/docs/function-documentation/Enable-VerkadaAccessUserCard.md +++ b/docs/function-documentation/Enable-VerkadaAccessUserCard.md @@ -14,27 +14,27 @@ Activates a credential for an Aceess user in an organization using https://apido ``` Enable-VerkadaAccessUserCard [[-userId] ] [[-externalId] ] [[-cardId] ] - [[-org_id] ] [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] - [-ProgressAction ] [] + [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] [-ProgressAction ] + [] ``` ## DESCRIPTION Given the Verkada defined User ID (OR user defined External ID)and Card ID, activate a specific access card for a user. Returns the updated Access Card Object. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Enable-VerkadaAccessUserCard -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -cardId '3f3b3e4d-1a67-4b88-a321-43c5e502991c' -This will activate the credential with cardId 10110010000000000000001011 for the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 as a credential. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will activate the credential with cardId 10110010000000000000001011 for the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 as a credential. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` -Enable-VerkadaAccessUserCard -externalId 'newUserUPN@contoso.com' -cardId '3f3b3e4d-1a67-4b88-a321-43c5e502991c' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This will activate the credential with cardId 10110010000000000000001011 for the Access user with externalId newUserUPN@contoso.com as a credential. The org_id and tokens are submitted as parameters in the call. +Enable-VerkadaAccessUserCard -externalId 'newUserUPN@contoso.com' -cardId '3f3b3e4d-1a67-4b88-a321-43c5e502991c' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This will activate the credential with cardId 10110010000000000000001011 for the Access user with externalId newUserUPN@contoso.com as a credential. The token is submitted as a parameter in the call. ``` ## PARAMETERS @@ -84,21 +84,6 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 4 -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -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 @@ -108,7 +93,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 5 +Position: 4 Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: False Accept wildcard characters: False @@ -123,7 +108,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 6 +Position: 5 Default value: Api Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/function-documentation/Enable-VerkadaAccessUserLicensePlate.md b/docs/function-documentation/Enable-VerkadaAccessUserLicensePlate.md index 1ea60fe..aae1350 100644 --- a/docs/function-documentation/Enable-VerkadaAccessUserLicensePlate.md +++ b/docs/function-documentation/Enable-VerkadaAccessUserLicensePlate.md @@ -14,27 +14,27 @@ Activates a license plate credential for an Aceess user in an organization using ``` Enable-VerkadaAccessUserLicensePlate [[-userId] ] [[-externalId] ] - [[-licensePlateNumber] ] [[-org_id] ] [[-x_verkada_auth_api] ] [[-region] ] - [-errorsToFile] [-ProgressAction ] [] + [[-licensePlateNumber] ] [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] + [-ProgressAction ] [] ``` ## DESCRIPTION Given the Verkada defined user ID (OR user defined External ID)and License Plate Number, activate a users License Plate Credential. Returns the updated License Plate Object. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Enable-VerkadaAccessUserLicensePlate -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -licensePlateNumber 'ABC123' -This will activate the license plate ABC123 for the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 as a credential. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will activate the license plate ABC123 for the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 as a credential. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` -Enable-VerkadaAccessUserLicensePlate -externalId 'newUserUPN@contoso.com' -licensePlateNumber 'ABC123' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This will activate the license plate ABC123 for the Access user with externalId newUserUPN@contoso.com as a credential. The org_id and tokens are submitted as parameters in the call. +Enable-VerkadaAccessUserLicensePlate -externalId 'newUserUPN@contoso.com' -licensePlateNumber 'ABC123' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This will activate the license plate ABC123 for the Access user with externalId newUserUPN@contoso.com as a credential. The token is submitted as a parameter in the call. ``` ## PARAMETERS @@ -84,21 +84,6 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 4 -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -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 @@ -108,7 +93,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 5 +Position: 4 Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: False Accept wildcard characters: False @@ -123,7 +108,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 6 +Position: 5 Default value: Api Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/function-documentation/Find-VerkadaHelixEvent.md b/docs/function-documentation/Find-VerkadaHelixEvent.md index ee40208..b5d276d 100644 --- a/docs/function-documentation/Find-VerkadaHelixEvent.md +++ b/docs/function-documentation/Find-VerkadaHelixEvent.md @@ -13,9 +13,9 @@ Finds Helix event using https://apidocs.verkada.com/reference/postvideotaggingev ## SYNTAX ``` -Find-VerkadaHelixEvent [[-org_id] ] [[-camera_ids] ] [[-event_type_uid] ] - [[-startTimeStamp] ] [[-start_epoch_time] ] [[-endTimeStamp] ] - [[-end_epoch_time] ] [[-attribute_filters] ] [[-keywords] ] [[-flagged] ] +Find-VerkadaHelixEvent [[-camera_ids] ] [[-event_type_uid] ] [[-startTimeStamp] ] + [[-start_epoch_time] ] [[-endTimeStamp] ] [[-end_epoch_time] ] + [[-attribute_filters] ] [[-keywords] ] [[-flagged] ] [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] [-ProgressAction ] [] ``` @@ -32,39 +32,24 @@ Camera ID: returns all Helix Events linked to that specific camera or list of ca Event Type UID: returns all Helix Events that share that specific Event Type UID. Start and End Times: returns all Helix Events that have occurred during that time range. Attributes Keys and Values: returns all Helix Events that have attributes keys and values matching the user's entered parameters. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Find-VerkadaHelixEvent -camera_id 6b8731d7-d991-4206-ba71-b5446fa617fc -This will get the helix events for camera_id 6b8731d7-d991-4206-ba71-b5446fa617fc. The org_id and token will be populated from the cached created by Connect-Verkada. +This will get the helix events for camera_id 6b8731d7-d991-4206-ba71-b5446fa617fc. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` -Find-VerkadaHelixEvent -event_type_uid cf918b16-26cd-4c01-a672-5a91b79311e1 -startTimeStamp '1/1/2025 08:35:00 -06' -endTimeStamp '1/7/2025 17:00:00 -06' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This will find the helix events for from Jan 1, 2025 at 8:35 AM CST to Jan 7, 2025 at 5:00 APM CST for the sepcified event ID. The org_id and token are submitted as parameters in the call. +Find-VerkadaHelixEvent -event_type_uid cf918b16-26cd-4c01-a672-5a91b79311e1 -startTimeStamp '1/1/2025 08:35:00 -06' -endTimeStamp '1/7/2025 17:00:00 -06' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This will find the helix events for from Jan 1, 2025 at 8:35 AM CST to Jan 7, 2025 at 5:00 APM CST for the sepcified event ID. The token is submitted as parameter in the call. ``` ## PARAMETERS -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 1 -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - ### -camera_ids The UUID of the camera who's name is being changed @@ -74,7 +59,7 @@ Parameter Sets: (All) Aliases: cameraId, cameraIds, camera_id Required: False -Position: 2 +Position: 1 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -89,7 +74,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 3 +Position: 2 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -104,7 +89,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 4 +Position: 3 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -119,7 +104,7 @@ Parameter Sets: (All) Aliases: start_time_ms Required: False -Position: 5 +Position: 4 Default value: 0 Accept pipeline input: False Accept wildcard characters: False @@ -134,7 +119,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 6 +Position: 5 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -149,7 +134,7 @@ Parameter Sets: (All) Aliases: end_time_ms Required: False -Position: 7 +Position: 6 Default value: 0 Accept pipeline input: False Accept wildcard characters: False @@ -164,7 +149,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 8 +Position: 7 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -179,7 +164,7 @@ Parameter Sets: (All) Aliases: keyword Required: False -Position: 9 +Position: 8 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -194,7 +179,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 10 +Position: 9 Default value: False Accept pipeline input: False Accept wildcard characters: False @@ -209,7 +194,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 11 +Position: 10 Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: False Accept wildcard characters: False @@ -224,7 +209,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 12 +Position: 11 Default value: Api Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/function-documentation/Get-VerkadaAccessEvents.md b/docs/function-documentation/Get-VerkadaAccessEvents.md index d7f1e4b..e4bd015 100644 --- a/docs/function-documentation/Get-VerkadaAccessEvents.md +++ b/docs/function-documentation/Get-VerkadaAccessEvents.md @@ -13,47 +13,32 @@ Returns Verkada Access Control events using https://apidocs.verkada.com/referenc ## SYNTAX ``` -Get-VerkadaAccessEvents [[-org_id] ] [[-x_verkada_auth_api] ] [[-region] ] - [[-start_time] ] [[-end_time] ] [[-event_type] ] [[-side_id] ] - [[-device_id] ] [[-user_id] ] [-toLocalTime] [-errorsToFile] - [-ProgressAction ] [] +Get-VerkadaAccessEvents [[-x_verkada_auth_api] ] [[-region] ] [[-start_time] ] + [[-end_time] ] [[-event_type] ] [[-side_id] ] [[-device_id] ] + [[-user_id] ] [-toLocalTime] [-errorsToFile] [-ProgressAction ] + [] ``` ## DESCRIPTION Returns events for an organization within a specified time range. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Get-VerkadaAccessEvents -This will return all the access events from 1 hour in the past until present. The org_id and token will be populated from the cached created by Connect-Verkada. +This will return all the access events from 1 hour in the past until present. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` -Get-VerkadaAccessEvents -start_time 'January 1, 2025 9:00:00AM' -end_time 'February 8, 2025 10:30:00PM' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This will return all the access events from Jan 1 at 9am to Feb 8 at 10:30pm. The org_id and token are submitted as parameters in the call. +Get-VerkadaAccessEvents -start_time 'January 1, 2025 9:00:00AM' -end_time 'February 8, 2025 10:30:00PM' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This will return all the access events from Jan 1 at 9am to Feb 8 at 10:30pm. The token is submitted as parameter in the call. ``` ## PARAMETERS -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 1 -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -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 @@ -63,7 +48,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 2 +Position: 1 Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: False Accept wildcard characters: False @@ -78,7 +63,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 3 +Position: 2 Default value: Api Accept pipeline input: False Accept wildcard characters: False @@ -93,7 +78,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 4 +Position: 3 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -108,7 +93,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 5 +Position: 4 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -123,7 +108,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 6 +Position: 5 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -138,7 +123,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 7 +Position: 6 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -153,7 +138,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 8 +Position: 7 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -168,7 +153,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 9 +Position: 8 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/function-documentation/Get-VerkadaAccessGroup.md b/docs/function-documentation/Get-VerkadaAccessGroup.md index 48ef079..fc31df7 100644 --- a/docs/function-documentation/Get-VerkadaAccessGroup.md +++ b/docs/function-documentation/Get-VerkadaAccessGroup.md @@ -13,33 +13,33 @@ Gets an Access group in an organization using https://apidocs.verkada.com/refere ## SYNTAX ``` -Get-VerkadaAccessGroup [[-groupId] ] [[-org_id] ] [[-x_verkada_auth_api] ] - [[-region] ] [-errorsToFile] [-ProgressAction ] [] +Get-VerkadaAccessGroup [[-groupId] ] [[-x_verkada_auth_api] ] [[-region] ] + [-errorsToFile] [-ProgressAction ] [] ``` ## DESCRIPTION Retrieves an access group specified by its Verkada-defined unique identifier(Group ID). The response is the Access Group Metadata Object for the desired Access Group. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Get-VerkadaAccessGroup -groupId '7858d17a-3f72-4506-8532-a4b6ba233c5e' -This will return the Access Group with userId "7858d17a-3f72-4506-8532-a4b6ba233c5e". The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will return the Access Group with userId "7858d17a-3f72-4506-8532-a4b6ba233c5e". The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` -Get-VerkadaAccessGroup -groupId '7858d17a-3f72-4506-8532-a4b6ba233c5e' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This will return the Access Group with userId "7858d17a-3f72-4506-8532-a4b6ba233c5e". The org_id and tokens are submitted as parameters in the call. +Get-VerkadaAccessGroup -groupId '7858d17a-3f72-4506-8532-a4b6ba233c5e' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This will return the Access Group with userId "7858d17a-3f72-4506-8532-a4b6ba233c5e". The token is submitted as a parameter in the call. ``` ### EXAMPLE 3 ``` Read-VerkadaAccessGroups | Where-Object {$_.name -eq "Executive Access"} | Get-VerkadaAccessGroup -This will return the Access Group named "Executive Access". The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will return the Access Group named "Executive Access". The token will be populated from the cache created by Connect-Verkada. ``` ## PARAMETERS @@ -59,21 +59,6 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -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 @@ -83,7 +68,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 3 +Position: 2 Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: False Accept wildcard characters: False @@ -98,7 +83,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 4 +Position: 3 Default value: Api Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/function-documentation/Get-VerkadaAccessUser.md b/docs/function-documentation/Get-VerkadaAccessUser.md index 614c251..2bbab5a 100644 --- a/docs/function-documentation/Get-VerkadaAccessUser.md +++ b/docs/function-documentation/Get-VerkadaAccessUser.md @@ -13,27 +13,26 @@ Gets an Access User in an organization using https://apidocs.verkada.com/referen ## SYNTAX ``` -Get-VerkadaAccessUser [[-userId] ] [[-externalId] ] [[-org_id] ] - [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] [-ProgressAction ] - [] +Get-VerkadaAccessUser [[-userId] ] [[-externalId] ] [[-x_verkada_auth_api] ] + [[-region] ] [-errorsToFile] [-ProgressAction ] [] ``` ## DESCRIPTION Given the Verkada created User ID or the user defined External ID, retrieve the Access Object Information for the specified user. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Get-VerkadaAccessUser -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -This will retrieve the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will retrieve the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` -Get-VerkadaAccessUser -externalId 'newUserUPN@contoso.com' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This will retrieve the Access user with externalId newUserUPN@contoso.com. The org_id and tokens are submitted as parameters in the call. +Get-VerkadaAccessUser -externalId 'newUserUPN@contoso.com' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This will retrieve the Access user with externalId newUserUPN@contoso.com. The token is submitted as a parameter in the call. ``` ## PARAMETERS @@ -68,21 +67,6 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -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 @@ -92,7 +76,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 4 +Position: 3 Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: False Accept wildcard characters: False @@ -107,7 +91,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 5 +Position: 4 Default value: Api Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/function-documentation/Get-VerkadaAccessUserProfilePicture.md b/docs/function-documentation/Get-VerkadaAccessUserProfilePicture.md index 7f0667a..df63da0 100644 --- a/docs/function-documentation/Get-VerkadaAccessUserProfilePicture.md +++ b/docs/function-documentation/Get-VerkadaAccessUserProfilePicture.md @@ -14,26 +14,26 @@ Retrieves a profile photo for the specified Access user using https://apidocs.ve ``` Get-VerkadaAccessUserProfilePicture [[-userId] ] [[-externalId] ] [[-outPath] ] - [[-original] ] [[-org_id] ] [[-x_verkada_auth_api] ] [[-region] ] - [-errorsToFile] [-ProgressAction ] [] + [[-original] ] [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] + [-ProgressAction ] [] ``` ## DESCRIPTION This will download the Access user's, specified by the user_Id or external_Id, current profile picture. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Export-VerkadaAccessUserProfilePicture -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -outPath './MyProfilePics' -This downloads the Access user's, with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3, picture to ./MyProfilePics/801c9551-b04c-4293-84ad-b0a6aa0588b3.jpg. The org_id and token will be populated from the cached created by Connect-Verkada. +This downloads the Access user's, with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3, picture to ./MyProfilePics/801c9551-b04c-4293-84ad-b0a6aa0588b3.jpg. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` -Export-VerkadaAccessUserProfilePicture -externalId 'newUserUPN@contoso.com' -outPath './MyProfilePics' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This downloads the Access user's, with externalId newUserUPN@contoso.com picture to ./MyProfilePics/newUserUPN.jpg. The org_id and token are submitted as parameters in the call. +Export-VerkadaAccessUserProfilePicture -externalId 'newUserUPN@contoso.com' -outPath './MyProfilePics' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This downloads the Access user's, with externalId newUserUPN@contoso.com picture to ./MyProfilePics/newUserUPN.jpg. The token is submitted as parameter in the call. ``` ## PARAMETERS @@ -98,21 +98,6 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 5 -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -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 @@ -122,7 +107,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 6 +Position: 5 Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: False Accept wildcard characters: False @@ -137,7 +122,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 7 +Position: 6 Default value: Api Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/function-documentation/Get-VerkadaCameraCloudBackupSettings.md b/docs/function-documentation/Get-VerkadaCameraCloudBackupSettings.md new file mode 100644 index 0000000..5386e6e --- /dev/null +++ b/docs/function-documentation/Get-VerkadaCameraCloudBackupSettings.md @@ -0,0 +1,149 @@ +--- +external help file: verkadaModule-help.xml +Module Name: verkadaModule +online version: https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Get-VerkadaCameraCloudBackupSettings.md +schema: 2.0.0 +--- + +# Get-VerkadaCameraCloudBackupSettings + +## SYNOPSIS +Gets a camera's cloud backup settings using https://apidocs.verkada.com/reference/getcloudbackupviewv1 + +## SYNTAX + +``` +Get-VerkadaCameraCloudBackupSettings [-camera_id] [-backup] [[-x_verkada_auth_api] ] + [[-region] ] [-errorsToFile] [-ProgressAction ] [] +``` + +## DESCRIPTION +This function will retrieve the cloud backup settings of the camera requested. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. + +## EXAMPLES + +### EXAMPLE 1 +``` +Get-VerkadaCameraCloudBackupSettings -camera_id "cwdfwfw-3f3-cwdf2-cameraId" +This will get the cloud backup settings of camera cwdfwfw-3f3-cwdf2-cameraId. The token will be populated from the cache created by Connect-Verkada. +``` + +### EXAMPLE 2 +``` +Get-VerkadaCameraCloudBackupSettings -camera_id "cwdfwfw-3f3-cwdf2-cameraId" -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This will get the cloud backup settings of camera cwdfwfw-3f3-cwdf2-cameraId. The token is submitted as a parameter in the call. +``` + +### EXAMPLE 3 +``` +Get-VerkadaCameraCloudBackupSettings -camera_id "cwdfwfw-3f3-cwdf2-cameraId" -backup +This will get the cloud backup settings of camera cwdfwfw-3f3-cwdf2-cameraId and write it to a csv. The token will be populated from the cache created by Connect-Verkada. +``` + +## PARAMETERS + +### -camera_id +The UUID of the camera who's cloud backup seetings are being retrieved + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -backup +Switch used to write the retrieved cloud backup settings to a csv. +This will prompt for the path and file name for the output csv when the backup switch is used + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +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: (All) +Aliases: + +Required: False +Position: 2 +Default value: $Global:verkadaConnection.x_verkada_auth_api +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -region +The region of the public API to be used + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: Api +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -errorsToFile +Switch to write errors to file + +```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 + +[https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Get-VerkadaCameraCloudBackupSettings.md](https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Get-VerkadaCameraCloudBackupSettings.md) + diff --git a/docs/function-documentation/Get-VerkadaCameras.md b/docs/function-documentation/Get-VerkadaCameras.md index 1977cc1..a6b5f2d 100644 --- a/docs/function-documentation/Get-VerkadaCameras.md +++ b/docs/function-documentation/Get-VerkadaCameras.md @@ -8,50 +8,50 @@ schema: 2.0.0 # Get-VerkadaCameras ## SYNOPSIS -Gets all cameras in an organization +Gets all the cameras and their details using https://apidocs.verkada.com/reference/getcamerainfoviewv1 ## SYNTAX ``` -Get-VerkadaCameras [[-org_id] ] [[-x_verkada_auth_api] ] [-region ] - [[-serial] ] [-refresh] [-ProgressAction ] [] +Get-VerkadaCameras [[-serial] ] [-refresh] [[-x_verkada_auth_api] ] [[-region] ] + [-errorsToFile] [-ProgressAction ] [] ``` ## DESCRIPTION -This function will retrieve the complete list of cameras in an organization. -Upon the first run the camera list will be cached until a new powershell session is initiated, Connect/Disconnect-Verkada is run, or you use the refresh switch. -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. +Returns details of all cameras within the organization. +Details returned per camera are name, site, location, model, serial number, camera ID, MAC address, local IP, device retention, extended cloud retention (if any), date camera added to command, firmware update status, camera status, location latitude, location longitude, and location angle (in degrees). +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Get-VerkadaCameras -This will return all the cameras in the org. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will return all the cameras in the org. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` -Get-VerkadaCameras -org_id 'deds343-uuid-of-org' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This will return all the cameras in the org. The org_id and tokens are submitted as parameters in the call. +Get-VerkadaCameras -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This will return all the cameras in the org. The token is submitted as a parameter in the call. ``` ### EXAMPLE 3 ``` Get-VerkadaCameras -serial -This will return the camera information using the serial. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will return the camera information using the serial. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 4 ``` Get-VerkadaCameras -refresh -This will return all the cameras in the org with the most recent data available from Command. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will return all the cameras in the org with the most recent data available from Command. The token will be populated from the cache created by Connect-Verkada. ``` ## PARAMETERS -### -org_id -The UUID of the organization the user belongs to +### -serial +The serial of the camera you are querying ```yaml Type: String @@ -60,28 +60,28 @@ Aliases: Required: False Position: 1 -Default value: $Global:verkadaConnection.org_id +Default value: None Accept pipeline input: True (ByPropertyName) 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 +### -refresh +Switch to force a refreshed list of cameras from Command ```yaml -Type: String +Type: SwitchParameter Parameter Sets: (All) Aliases: Required: False -Position: 2 -Default value: $Global:verkadaConnection.x_verkada_auth_api +Position: Named +Default value: False Accept pipeline input: False Accept wildcard characters: False ``` -### -region -The region of the public API to be used +### -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 @@ -89,14 +89,14 @@ Parameter Sets: (All) Aliases: Required: False -Position: Named -Default value: Api +Position: 2 +Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: False Accept wildcard characters: False ``` -### -serial -The serial of the camera you are querying +### -region +The region of the public API to be used ```yaml Type: String @@ -105,13 +105,13 @@ Aliases: Required: False Position: 3 -Default value: None -Accept pipeline input: True (ByPropertyName) +Default value: Api +Accept pipeline input: False Accept wildcard characters: False ``` -### -refresh -Switch to force a refreshed list of cameras from Command +### -errorsToFile +Switch to write errors to file ```yaml Type: SwitchParameter diff --git a/docs/function-documentation/Get-VerkadaCommandUser.md b/docs/function-documentation/Get-VerkadaCommandUser.md index b39e34b..f818228 100644 --- a/docs/function-documentation/Get-VerkadaCommandUser.md +++ b/docs/function-documentation/Get-VerkadaCommandUser.md @@ -13,27 +13,26 @@ using https://apidocs.verkada.com/reference/getuserviewv1 ## SYNTAX ``` -Get-VerkadaCommandUser [[-userId] ] [[-externalId] ] [[-org_id] ] - [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] [-ProgressAction ] - [] +Get-VerkadaCommandUser [[-userId] ] [[-externalId] ] [[-x_verkada_auth_api] ] + [[-region] ] [-errorsToFile] [-ProgressAction ] [] ``` ## DESCRIPTION Returns a user for an organization based on either provided user ID or an external ID set during creation. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Get-VerkadaCommandUser -userId '3651fbcb-f8ba-4248-ad70-3f6512fd7b6c' -This will attempt to get the user details of a user with the userId of '3651fbcb-f8ba-4248-ad70-3f6512fd7b6c'. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will attempt to get the user details of a user with the userId of '3651fbcb-f8ba-4248-ad70-3f6512fd7b6c'. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` -Get-VerkadaCommandUser -externalId 'UserUPN@contoso.com' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This will attempt to get the user details of a user with the externalId UserUPN@contoso.com. The org_id and tokens are submitted as parameters in the call. +Get-VerkadaCommandUser -externalId 'UserUPN@contoso.com' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This will attempt to get the user details of a user with the externalId UserUPN@contoso.com. The token is submitted as a parameter in the call. ``` ## PARAMETERS @@ -68,21 +67,6 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -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 @@ -92,7 +76,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 4 +Position: 3 Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: False Accept wildcard characters: False @@ -107,7 +91,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 5 +Position: 4 Default value: Api Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/function-documentation/Get-VerkadaHelixEvent.md b/docs/function-documentation/Get-VerkadaHelixEvent.md index 9e6fbbc..520ceb9 100644 --- a/docs/function-documentation/Get-VerkadaHelixEvent.md +++ b/docs/function-documentation/Get-VerkadaHelixEvent.md @@ -13,48 +13,33 @@ Gets a specific Helix event using https://apidocs.verkada.com/reference/getvideo ## SYNTAX ``` -Get-VerkadaHelixEvent [[-org_id] ] [-camera_id] [-event_type_uid] - [[-timeStamp] ] [[-epoch_time] ] [[-x_verkada_auth_api] ] [[-region] ] - [-errorsToFile] [-ProgressAction ] [] +Get-VerkadaHelixEvent [-camera_id] [-event_type_uid] [[-timeStamp] ] + [[-epoch_time] ] [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] + [-ProgressAction ] [] ``` ## DESCRIPTION This method can be used to retrieve a Helix Event that has already been posted to Command. In the return message, the users will be able to see the corresponding attribute values for that unique event. To successfully retrieve a Helix Event, users will need to input the associated Camera ID, API Token with Helix permissions, Event Type UID, and the exact event epoch time in milliseconds. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Get-VerkadaHelixEvent -camera_id 6b8731d7-d991-4206-ba71-b5446fa617fc -event_type_uid cf918b16-26cd-4c01-a672-5a91b79311e1 -timeStamp '1/1/2025 08:35:00 -06' -This will get the helix event for Jan 1, 2025 at 8:35 AM CST for the sepcified camera, and event ID. The org_id and token will be populated from the cached created by Connect-Verkada. +This will get the helix event for Jan 1, 2025 at 8:35 AM CST for the sepcified camera, and event ID. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` -Get-VerkadaHelixEvent -camera_id 6b8731d7-d991-4206-ba71-b5446fa617fc -event_type_uid cf918b16-26cd-4c01-a672-5a91b79311e1 -timeStamp '1/1/2025 08:35:00 -06' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This will get the helix event for Jan 1, 2025 at 8:35 AM CST for the sepcified camera, and event ID. The org_id and token are submitted as parameters in the call. +Get-VerkadaHelixEvent -camera_id 6b8731d7-d991-4206-ba71-b5446fa617fc -event_type_uid cf918b16-26cd-4c01-a672-5a91b79311e1 -timeStamp '1/1/2025 08:35:00 -06' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This will get the helix event for Jan 1, 2025 at 8:35 AM CST for the sepcified camera, and event ID. The token is submitted as a parameter in the call. ``` ## PARAMETERS -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 1 -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - ### -camera_id The UUID of the camera who's name is being changed @@ -64,7 +49,7 @@ Parameter Sets: (All) Aliases: cameraId Required: True -Position: 2 +Position: 1 Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False @@ -79,7 +64,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 3 +Position: 2 Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False @@ -94,7 +79,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 4 +Position: 3 Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False @@ -109,7 +94,7 @@ Parameter Sets: (All) Aliases: time_ms Required: False -Position: 5 +Position: 4 Default value: 0 Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False @@ -124,7 +109,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 6 +Position: 5 Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: False Accept wildcard characters: False @@ -139,7 +124,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 7 +Position: 6 Default value: Api Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/function-documentation/Get-VerkadaLicensePlatesOfInterest.md b/docs/function-documentation/Get-VerkadaLicensePlatesOfInterest.md index 66090a4..7c05cd7 100644 --- a/docs/function-documentation/Get-VerkadaLicensePlatesOfInterest.md +++ b/docs/function-documentation/Get-VerkadaLicensePlatesOfInterest.md @@ -13,38 +13,38 @@ Returns creation time, description, and license plate number for all License Pla ## SYNTAX ``` -Get-VerkadaLicensePlatesOfInterest [[-org_id] ] [[-x_verkada_auth_api] ] +Get-VerkadaLicensePlatesOfInterest [[-x_verkada_auth_api] ] [-errorsToFile] [-ProgressAction ] [] ``` ## DESCRIPTION This function uses the public api endpoint(https://api.verkada.com/cameras/v1/analytics/lpr/license_plate_of_interest) to returns creation time, description, and license plate number for all License Plates of Interest for 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Get-VerkadaLicensePlatesOfInterest -The org_id and tokens will be populated from the cached created by Connect-Verkada. +The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` Get-VerkadaLPoI -The org_id and tokens will be populated from the cached created by Connect-Verkada. +The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 3 ``` -Get-VerkadaLicensePlatesOfInterest -org_id 'deds343-uuid-of-org' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -The org_id and tokens are submitted as parameters in the call. +Get-VerkadaLicensePlatesOfInterest -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +The token is submitted as a parameter in the call. ``` ## PARAMETERS -### -org_id -The UUID of the organization the user belongs to +### -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 @@ -53,23 +53,23 @@ Aliases: Required: False Position: 1 -Default value: $Global:verkadaConnection.org_id +Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: True (ByPropertyName) 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 +### -errorsToFile +Switch to write errors to file ```yaml -Type: String +Type: SwitchParameter Parameter Sets: (All) Aliases: Required: False -Position: 2 -Default value: $Global:verkadaConnection.x_verkada_auth_api -Accept pipeline input: True (ByPropertyName) +Position: Named +Default value: False +Accept pipeline input: False Accept wildcard characters: False ``` diff --git a/docs/function-documentation/Invoke-VerkadaFormCall.md b/docs/function-documentation/Invoke-VerkadaFormCall.md index 798e019..d473c5b 100644 --- a/docs/function-documentation/Invoke-VerkadaFormCall.md +++ b/docs/function-documentation/Invoke-VerkadaFormCall.md @@ -14,8 +14,8 @@ Used to build an Invoke-RestMethod call for Verkada's private API enpoints that ### Default (Default) ``` -Invoke-VerkadaFormCall [-url] [-org_id] [-form_params] [-query_params ] - [-method ] [-x_verkada_auth_api ] [-ProgressAction ] [] +Invoke-VerkadaFormCall [-url] [-form_params] [-query_params ] [-method ] + [-x_verkada_auth_api ] [-ProgressAction ] [] ``` ### UnPwd @@ -59,7 +59,7 @@ The UUID of the organization the user belongs to ```yaml Type: String -Parameter Sets: (All) +Parameter Sets: UnPwd Aliases: Required: True @@ -78,7 +78,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 3 +Position: 2 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/function-documentation/Invoke-VerkadaRestMethod.md b/docs/function-documentation/Invoke-VerkadaRestMethod.md index 45e04af..1295dd3 100644 --- a/docs/function-documentation/Invoke-VerkadaRestMethod.md +++ b/docs/function-documentation/Invoke-VerkadaRestMethod.md @@ -14,9 +14,9 @@ Used to build an Invoke-RestMethod call for Verkada's private API enpoints ### Default (Default) ``` -Invoke-VerkadaRestMethod [-url] [-org_id] [-x_verkada_auth_api] - [[-query_params] ] [[-body_params] ] [-method ] [-outFile ] - [-ProgressAction ] [] +Invoke-VerkadaRestMethod [-url] [-x_verkada_auth_api] [[-query_params] ] + [[-body_params] ] [-method ] [-outFile ] [-ProgressAction ] + [] ``` ### UnPwd @@ -28,9 +28,9 @@ Invoke-VerkadaRestMethod [-url] [-org_id] [[-body_params] [-org_id] [-x_verkada_auth_api] - [[-query_params] ] [[-body_params] ] [-method ] [-pagination] -page_size - -propertyName [-outFile ] [-ProgressAction ] [] +Invoke-VerkadaRestMethod [-url] [-x_verkada_auth_api] [[-query_params] ] + [[-body_params] ] [-method ] [-pagination] -page_size -propertyName + [-outFile ] [-ProgressAction ] [] ``` ## DESCRIPTION @@ -67,7 +67,7 @@ The UUID of the organization the user belongs to ```yaml Type: String -Parameter Sets: (All) +Parameter Sets: UnPwd Aliases: Required: True @@ -86,7 +86,7 @@ Parameter Sets: Default, Pagination Aliases: Required: True -Position: 3 +Position: 2 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -101,7 +101,7 @@ Parameter Sets: Default, Pagination Aliases: Required: False -Position: 4 +Position: 3 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -116,7 +116,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 5 +Position: 4 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/function-documentation/Read-VerkadaAccessGroups.md b/docs/function-documentation/Read-VerkadaAccessGroups.md index 2511909..e7bd57d 100644 --- a/docs/function-documentation/Read-VerkadaAccessGroups.md +++ b/docs/function-documentation/Read-VerkadaAccessGroups.md @@ -13,46 +13,31 @@ Gets all the Access groups in an organization using https://apidocs.verkada.com/ ## SYNTAX ``` -Read-VerkadaAccessGroups [[-org_id] ] [[-x_verkada_auth_api] ] [[-region] ] - [-errorsToFile] [-ProgressAction ] [] +Read-VerkadaAccessGroups [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] + [-ProgressAction ] [] ``` ## DESCRIPTION Retrieves a list of all access groups in a given organization. The response is a list of Access Group Objects. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Read-VerkadaAccessGroups -This will return aa the Access Groups. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will return aa the Access Groups. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` -Read-VerkadaAccessGroups -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This will return aa the Access Groups. The org_id and tokens are submitted as parameters in the call. +Read-VerkadaAccessGroups -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This will return aa the Access Groups. The token is submitted as a parameter in the call. ``` ## PARAMETERS -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 1 -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -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 @@ -62,7 +47,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 2 +Position: 1 Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: False Accept wildcard characters: False @@ -77,7 +62,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 3 +Position: 2 Default value: Api Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/function-documentation/Read-VerkadaAccessUsers.md b/docs/function-documentation/Read-VerkadaAccessUsers.md index d9dca54..8bedc63 100644 --- a/docs/function-documentation/Read-VerkadaAccessUsers.md +++ b/docs/function-documentation/Read-VerkadaAccessUsers.md @@ -12,17 +12,17 @@ Gathers all Access Users in an organization via the legacy private API or using ## SYNTAX -### legacy (Default) +### legacy ``` -Read-VerkadaAccessUsers [-org_id ] [[-query] ] [[-variables] ] [-region ] +Read-VerkadaAccessUsers [[-query] ] [[-variables] ] [-region ] [-x_verkada_token ] [-x_verkada_auth ] [-usr ] [-refresh] [-minimal] [-version ] [-ProgressAction ] [] ``` ### v1 ``` -Read-VerkadaAccessUsers [-org_id ] [-x_verkada_auth_api ] [-region ] [-refresh] - [-version ] [-errorsToFile] [-ProgressAction ] [] +Read-VerkadaAccessUsers [-x_verkada_auth_api ] [-region ] [-refresh] [-version ] + [-errorsToFile] [-ProgressAction ] [] ``` ## DESCRIPTION @@ -34,44 +34,29 @@ The org_id and reqired tokens can be directly submitted as parameters, but is mu ### EXAMPLE 1 ``` Read-VerkadaAccessUsers -This will return all the active access users in an organization. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will return all the active access users in an organization. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` Read-VerkadaAccessUsers -userId 'aefrfefb-3429-39ec-b042-userAC' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_token 'a366ef47-2c20-4d35-a90a-10fd2aee113a' -x_verkada_auth 'auth-token-uuid-dscsdc' -usr 'a099bfe6-34ff-4976-9d53-ac68342d2b60' -This will return all the active access users in an organization. The org_id and tokens are submitted as parameters in the call. +This will return all the active access users in an organization. The token is submitted as a parameter in the call. ``` ### EXAMPLE 3 ``` -Read-VerkadaAccessUsers -version v1 -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This will return all the active access users in an organization using the Command v1 public API endpoint. The org_id and tokens are submitted as parameters in the call. +Read-VerkadaAccessUsers -version v1 -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This will return all the active access users in an organization using the Command v1 public API endpoint. The token is submitted as a parameter in the call. ``` ### EXAMPLE 4 ``` 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 org_id and tokens will be populated from the cached created by Connect-Verkada. +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. ``` ## PARAMETERS -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - ### -query This is the graphql query to be submitted (do not use unless you know what you are doing) diff --git a/docs/function-documentation/Read-VerkadaGuestSites.md b/docs/function-documentation/Read-VerkadaGuestSites.md index dc702ac..6111f09 100644 --- a/docs/function-documentation/Read-VerkadaGuestSites.md +++ b/docs/function-documentation/Read-VerkadaGuestSites.md @@ -13,45 +13,30 @@ Gets all the Guest sites in an organization using https://apidocs.verkada.com/re ## SYNTAX ``` -Read-VerkadaGuestSites [[-org_id] ] [[-x_verkada_auth_api] ] [[-region] ] - [-errorsToFile] [-ProgressAction ] [] +Read-VerkadaGuestSites [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] + [-ProgressAction ] [] ``` ## DESCRIPTION Retrieves a list of all the Guest sites in an organization. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Read-VerkadaGuestSites -This will return all the Guest in an organization. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will return all the Guest in an organization. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` Read-VerkadaGuestSites -userId 'aefrfefb-3429-39ec-b042-userAC' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_token 'a366ef47-2c20-4d35-a90a-10fd2aee113a' -x_verkada_auth 'auth-token-uuid-dscsdc' -usr 'a099bfe6-34ff-4976-9d53-ac68342d2b60' -This will return all the Guest sites in an organization. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will return all the Guest sites in an organization. The token will be populated from the cache created by Connect-Verkada. ``` ## PARAMETERS -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 1 -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -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 @@ -61,7 +46,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 2 +Position: 1 Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: False Accept wildcard characters: False @@ -76,7 +61,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 3 +Position: 2 Default value: Api Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/function-documentation/Remove-VerkadaAccessGroup.md b/docs/function-documentation/Remove-VerkadaAccessGroup.md index 143ea54..3fdda27 100644 --- a/docs/function-documentation/Remove-VerkadaAccessGroup.md +++ b/docs/function-documentation/Remove-VerkadaAccessGroup.md @@ -13,26 +13,26 @@ Deletes an Access group in an organization using https://apidocs.verkada.com/ref ## SYNTAX ``` -Remove-VerkadaAccessGroup [[-groupId] ] [[-org_id] ] [[-x_verkada_auth_api] ] - [[-region] ] [-errorsToFile] [-ProgressAction ] [] +Remove-VerkadaAccessGroup [[-groupId] ] [[-x_verkada_auth_api] ] [[-region] ] + [-errorsToFile] [-ProgressAction ] [] ``` ## DESCRIPTION Delete an access group with the given group identifier within the given organization. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Remove-VerkadaAccessGroup -groupId '2d64e7de-fd95-48be-8b5c-7a23bde94f52' -This will delete the Access group with the groupId 2d64e7de-fd95-48be-8b5c-7a23bde94f52. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will delete the Access group with the groupId 2d64e7de-fd95-48be-8b5c-7a23bde94f52. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` -Remove-VerkadaAccessGroup -groupId '2d64e7de-fd95-48be-8b5c-7a23bde94f52' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This will delete the Access group with the groupId 2d64e7de-fd95-48be-8b5c-7a23bde94f52. The org_id and tokens are submitted as parameters in the call. +Remove-VerkadaAccessGroup -groupId '2d64e7de-fd95-48be-8b5c-7a23bde94f52' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This will delete the Access group with the groupId 2d64e7de-fd95-48be-8b5c-7a23bde94f52. The token is submitted as a parameter in the call. ``` ## PARAMETERS @@ -52,21 +52,6 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -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 @@ -76,7 +61,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 3 +Position: 2 Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: False Accept wildcard characters: False @@ -91,7 +76,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 4 +Position: 3 Default value: Api Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/function-documentation/Remove-VerkadaAccessUserBleUnlock.md b/docs/function-documentation/Remove-VerkadaAccessUserBleUnlock.md index 39a727c..bf861d7 100644 --- a/docs/function-documentation/Remove-VerkadaAccessUserBleUnlock.md +++ b/docs/function-documentation/Remove-VerkadaAccessUserBleUnlock.md @@ -13,7 +13,7 @@ Deactivates a Access User's ability to use Bluetooth Unlock using https://apidoc ## SYNTAX ``` -Remove-VerkadaAccessUserBleUnlock [[-userId] ] [[-externalId] ] [[-org_id] ] +Remove-VerkadaAccessUserBleUnlock [[-userId] ] [[-externalId] ] [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] [-ProgressAction ] [] ``` @@ -21,20 +21,20 @@ Remove-VerkadaAccessUserBleUnlock [[-userId] ] [[-externalId] ] ## DESCRIPTION Given the user defined External ID or Verkada defined User ID (but not both), deactivate bluetooth unlock capability for a user. Response is updated Access Information Object. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Remove-VerkadaAccessUserBleUnlock -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -This will deactivate the Access user's Bluetooth unlock ability with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will deactivate the Access user's Bluetooth unlock ability with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` -Remove-VerkadaAccessUserBleUnlock -externalId 'newUserUPN@contoso.com' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This will deactivate the Access user's Bluetooth unlock ability with externalId newUserUPN@contoso.com. The org_id and tokens are submitted as parameters in the call. +Remove-VerkadaAccessUserBleUnlock -externalId 'newUserUPN@contoso.com' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This will deactivate the Access user's Bluetooth unlock ability with externalId newUserUPN@contoso.com. The token is submitted as a parameter in the call. ``` ## PARAMETERS @@ -69,21 +69,6 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -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 @@ -93,7 +78,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 4 +Position: 3 Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: False Accept wildcard characters: False @@ -108,7 +93,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 5 +Position: 4 Default value: Api Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/function-documentation/Remove-VerkadaAccessUserCard.md b/docs/function-documentation/Remove-VerkadaAccessUserCard.md index cdbd8e3..97e12ef 100644 --- a/docs/function-documentation/Remove-VerkadaAccessUserCard.md +++ b/docs/function-documentation/Remove-VerkadaAccessUserCard.md @@ -14,26 +14,26 @@ Deletes a credential for an Aceess user in an organization using https://apidocs ``` Remove-VerkadaAccessUserCard [[-userId] ] [[-externalId] ] [[-cardId] ] - [[-org_id] ] [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] - [-ProgressAction ] [] + [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] [-ProgressAction ] + [] ``` ## DESCRIPTION Deletes an access card of a specified access user given their user_id or external_id, the org_id, and the card_id. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Remove-VerkadaAccessUserCard -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -cardId '10110010000000000000001011' -This will delete the credential with cardId 10110010000000000000001011 for the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 as a credential. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will delete the credential with cardId 10110010000000000000001011 for the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 as a credential. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` -Remove-VerkadaAccessUserCard -externalId 'newUserUPN@contoso.com' -cardId '10110010000000000000001011' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This will delete the credential with cardId 10110010000000000000001011 for the Access user with externalId newUserUPN@contoso.com as a credential. The org_id and tokens are submitted as parameters in the call. +Remove-VerkadaAccessUserCard -externalId 'newUserUPN@contoso.com' -cardId '10110010000000000000001011' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This will delete the credential with cardId 10110010000000000000001011 for the Access user with externalId newUserUPN@contoso.com as a credential. The token is submitted as a parameter in the call. ``` ## PARAMETERS @@ -83,21 +83,6 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 4 -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -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 @@ -107,7 +92,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 5 +Position: 4 Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: False Accept wildcard characters: False @@ -122,7 +107,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 6 +Position: 5 Default value: Api Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/function-documentation/Remove-VerkadaAccessUserEntryCode.md b/docs/function-documentation/Remove-VerkadaAccessUserEntryCode.md index 125b7cf..84ad4ee 100644 --- a/docs/function-documentation/Remove-VerkadaAccessUserEntryCode.md +++ b/docs/function-documentation/Remove-VerkadaAccessUserEntryCode.md @@ -13,7 +13,7 @@ Removes an Access User's entry code using https://apidocs.verkada.com/reference/ ## SYNTAX ``` -Remove-VerkadaAccessUserEntryCode [[-userId] ] [[-externalId] ] [[-org_id] ] +Remove-VerkadaAccessUserEntryCode [[-userId] ] [[-externalId] ] [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] [-ProgressAction ] [] ``` @@ -21,20 +21,20 @@ Remove-VerkadaAccessUserEntryCode [[-userId] ] [[-externalId] ] ## DESCRIPTION Given the user defined External ID or Verkada defined User ID (but not both), remove the entry code of a user. Returns the updated access information object. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Remove-VerkadaAccessUserEntryCode -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -This will remove the Access user's entry code with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will remove the Access user's entry code with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` -Remove-VerkadaAccessUserEntryCode -externalId 'newUserUPN@contoso.com' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This will remove the Access user's entry code with externalId newUserUPN@contoso.com. The org_id and tokens are submitted as parameters in the call. +Remove-VerkadaAccessUserEntryCode -externalId 'newUserUPN@contoso.com' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This will remove the Access user's entry code with externalId newUserUPN@contoso.com. The token is submitted as a parameter in the call. ``` ## PARAMETERS @@ -69,21 +69,6 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -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 @@ -93,7 +78,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 4 +Position: 3 Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: False Accept wildcard characters: False @@ -108,7 +93,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 5 +Position: 4 Default value: Api Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/function-documentation/Remove-VerkadaAccessUserFromGroup.md b/docs/function-documentation/Remove-VerkadaAccessUserFromGroup.md index 1f84dc3..2f94dce 100644 --- a/docs/function-documentation/Remove-VerkadaAccessUserFromGroup.md +++ b/docs/function-documentation/Remove-VerkadaAccessUserFromGroup.md @@ -14,27 +14,27 @@ Removes an Access user from an Access group in an organization using https://api ``` Remove-VerkadaAccessUserFromGroup [[-userId] ] [[-externalId] ] [[-groupId] ] - [[-org_id] ] [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] - [-ProgressAction ] [] + [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] [-ProgressAction ] + [] ``` ## DESCRIPTION Remove an access user from an access group with the Verkada defined group ID and the user defined either by their User ID or their External ID. Both the group ID and the User ID(or External ID) are passed as query parameters in the URL. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Remove-VerkadaAccessUserFromGroup -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -groupId '2d64e7de-fd95-48be-8b5c-7a23bde94f52' -This will remove the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 from the group with groupId 2d64e7de-fd95-48be-8b5c-7a23bde94f52. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will remove the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 from the group with groupId 2d64e7de-fd95-48be-8b5c-7a23bde94f52. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` -Remove-VerkadaAccessUserFromGroup -externalId 'newUserUPN@contoso.com' -groupId '2d64e7de-fd95-48be-8b5c-7a23bde94f52' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This will remove the Access user with externalId newUserUPN@contoso.com from the group with groupId 2d64e7de-fd95-48be-8b5c-7a23bde94f52. The org_id and tokens are submitted as parameters in the call. +Remove-VerkadaAccessUserFromGroup -externalId 'newUserUPN@contoso.com' -groupId '2d64e7de-fd95-48be-8b5c-7a23bde94f52' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This will remove the Access user with externalId newUserUPN@contoso.com from the group with groupId 2d64e7de-fd95-48be-8b5c-7a23bde94f52. The token is submitted as a parameter in the call. ``` ## PARAMETERS @@ -84,21 +84,6 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 4 -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -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 @@ -108,7 +93,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 5 +Position: 4 Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: False Accept wildcard characters: False @@ -123,7 +108,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 6 +Position: 5 Default value: Api Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/function-documentation/Remove-VerkadaAccessUserLicensePlate.md b/docs/function-documentation/Remove-VerkadaAccessUserLicensePlate.md index 04b75ff..28bd7bd 100644 --- a/docs/function-documentation/Remove-VerkadaAccessUserLicensePlate.md +++ b/docs/function-documentation/Remove-VerkadaAccessUserLicensePlate.md @@ -14,26 +14,26 @@ Removes a license plate credential from an Aceess user in an organization using ``` Remove-VerkadaAccessUserLicensePlate [[-userId] ] [[-externalId] ] - [[-licensePlateNumber] ] [[-org_id] ] [[-x_verkada_auth_api] ] [[-region] ] - [-errorsToFile] [-ProgressAction ] [] + [[-licensePlateNumber] ] [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] + [-ProgressAction ] [] ``` ## DESCRIPTION Deletes a license plate credential from a specified user by providing the user_id or the external_id, the org_id, and the license_plate_number. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Remove-VerkadaAccessUserLicensePlate -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -licensePlateNumber 'ABC123' -This will remove license plate ABC123 as a credential from the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will remove license plate ABC123 as a credential from the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` -Remove-VerkadaAccessUserLicensePlate -externalId 'newUserUPN@contoso.com' -licensePlateNumber 'ABC123' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This will remove license plate ABC123 as a credential from the Access user with externalId newUserUPN@contoso.com. The org_id and tokens are submitted as parameters in the call. +Remove-VerkadaAccessUserLicensePlate -externalId 'newUserUPN@contoso.com' -licensePlateNumber 'ABC123' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This will remove license plate ABC123 as a credential from the Access user with externalId newUserUPN@contoso.com. The token is submitted as a parameter in the call. ``` ## PARAMETERS @@ -83,21 +83,6 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 4 -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -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 @@ -107,7 +92,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 5 +Position: 4 Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: False Accept wildcard characters: False @@ -122,7 +107,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 6 +Position: 5 Default value: Api Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/function-documentation/Remove-VerkadaAccessUserMfaCode.md b/docs/function-documentation/Remove-VerkadaAccessUserMfaCode.md index 25247df..74e0055 100644 --- a/docs/function-documentation/Remove-VerkadaAccessUserMfaCode.md +++ b/docs/function-documentation/Remove-VerkadaAccessUserMfaCode.md @@ -14,26 +14,26 @@ Deletes a mfa code credential from a specified user using https://apidocs.verkad ``` Remove-VerkadaAccessUserMfaCode [[-userId] ] [[-externalId] ] [[-mfaCode] ] - [[-org_id] ] [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] - [-ProgressAction ] [] + [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] [-ProgressAction ] + [] ``` ## DESCRIPTION Deletes a mfa code credential from a specified user by providing the user_id or the external_id, the org_id, and the mfa_code. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Remove-VerkadaAccessUserMfaCode -mfaCode '9567' -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -This deletes the MFA code 9567 from the Access user's profile with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The org_id and token will be populated from the cached created by Connect-Verkada. +This deletes the MFA code 9567 from the Access user's profile with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` -Remove-VerkadaAccessUserMfaCode -mfaCode '9567' -externalId 'newUserUPN@contoso.com' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This deletes the MFA code 9567 from the Access user's profile with externalId newUserUPN@contoso.com. The org_id and token are submitted as parameters in the call. +Remove-VerkadaAccessUserMfaCode -mfaCode '9567' -externalId 'newUserUPN@contoso.com' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This deletes the MFA code 9567 from the Access user's profile with externalId newUserUPN@contoso.com. The token is submitted as a parameter in the call. ``` ## PARAMETERS @@ -83,21 +83,6 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 4 -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -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 @@ -107,7 +92,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 5 +Position: 4 Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: False Accept wildcard characters: False @@ -122,7 +107,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 6 +Position: 5 Default value: Api Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/function-documentation/Remove-VerkadaAccessUserProfilePicture.md b/docs/function-documentation/Remove-VerkadaAccessUserProfilePicture.md index 7d9a83b..6b07e6b 100644 --- a/docs/function-documentation/Remove-VerkadaAccessUserProfilePicture.md +++ b/docs/function-documentation/Remove-VerkadaAccessUserProfilePicture.md @@ -13,27 +13,27 @@ Deletes a profile photo for the specified user using https://apidocs.verkada.com ## SYNTAX ``` -Remove-VerkadaAccessUserProfilePicture [[-userId] ] [[-externalId] ] [[-org_id] ] +Remove-VerkadaAccessUserProfilePicture [[-userId] ] [[-externalId] ] [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] [-ProgressAction ] [] ``` ## DESCRIPTION This will remove the Access user's, specified by the user_Id or external_Id, profile picture. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Remove-VerkadaAccessUserProfilePicture -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -This removes the Access user's profile picture with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This removes the Access user's profile picture with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` -Remove-VerkadaAccessUserProfilePicture -externalId 'newUserUPN@contoso.com' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This removes the Access user's profile picture with externalId newUserUPN@contoso.com. The org_id and tokens are submitted as parameters in the call. +Remove-VerkadaAccessUserProfilePicture -externalId 'newUserUPN@contoso.com' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This removes the Access user's profile picture with externalId newUserUPN@contoso.com. The token is submitted as a parameter in the call. ``` ## PARAMETERS @@ -68,21 +68,6 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -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 @@ -92,7 +77,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 4 +Position: 3 Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: False Accept wildcard characters: False @@ -107,7 +92,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 5 +Position: 4 Default value: Api Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/function-documentation/Remove-VerkadaAccessUserRemoteUnlock.md b/docs/function-documentation/Remove-VerkadaAccessUserRemoteUnlock.md index d031a17..59eba56 100644 --- a/docs/function-documentation/Remove-VerkadaAccessUserRemoteUnlock.md +++ b/docs/function-documentation/Remove-VerkadaAccessUserRemoteUnlock.md @@ -13,27 +13,27 @@ Deactivates an Access User's ability to use Remote Unlock using https://apidocs. ## SYNTAX ``` -Remove-VerkadaAccessUserRemoteUnlock [[-userId] ] [[-externalId] ] [[-org_id] ] +Remove-VerkadaAccessUserRemoteUnlock [[-userId] ] [[-externalId] ] [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] [-ProgressAction ] [] ``` ## DESCRIPTION Given the user defined External ID or Verkada defined User ID (but not both) and the Organization ID, deactivate remote unlock capability for a user.Returns the updated Access Information Object. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Remove-VerkadaAccessUserRemoteUnlock -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -This will deactivate the Access user's Remote unlock ability with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will deactivate the Access user's Remote unlock ability with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` -Remove-VerkadaAccessUserRemoteUnlock -externalId 'newUserUPN@contoso.com' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This will deactivate the Access user's Remote unlock ability with externalId newUserUPN@contoso.com. The org_id and tokens are submitted as parameters in the call. +Remove-VerkadaAccessUserRemoteUnlock -externalId 'newUserUPN@contoso.com' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This will deactivate the Access user's Remote unlock ability with externalId newUserUPN@contoso.com. The token is submitted as a parameter in the call. ``` ## PARAMETERS @@ -68,21 +68,6 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -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 @@ -92,7 +77,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 4 +Position: 3 Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: False Accept wildcard characters: False @@ -107,7 +92,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 5 +Position: 4 Default value: Api Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/function-documentation/Remove-VerkadaCameraLicensePlateOfInterest.md b/docs/function-documentation/Remove-VerkadaCameraLicensePlateOfInterest.md new file mode 100644 index 0000000..0653775 --- /dev/null +++ b/docs/function-documentation/Remove-VerkadaCameraLicensePlateOfInterest.md @@ -0,0 +1,139 @@ +--- +external help file: verkadaModule-help.xml +Module Name: verkadaModule +online version: https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Remove-VerkadaCameraLicensePlateOfInterest.md +schema: 2.0.0 +--- + +# Remove-VerkadaCameraLicensePlateOfInterest + +## SYNOPSIS +This removes a license plate from being an LPoI using https://apidocs.verkada.com/reference/deletelicenseplateofinterestviewv1 + +## SYNTAX + +``` +Remove-VerkadaCameraLicensePlateOfInterest [-license_plate] [-x_verkada_auth_api ] + [-region ] [-errorsToFile] [-ProgressAction ] [] +``` + +## DESCRIPTION +Deletes a license plate from License Plates of Interest using a specified license plate number. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. + +## EXAMPLES + +### EXAMPLE 1 +``` +Remove-VerkadaCameraLicensePlateOfInterest -license_plate 'ABC123' +The token will be populated from the cache created by Connect-Verkada. +``` + +### EXAMPLE 2 +``` +Remove-VerkadaLPoI 'ABC123' +The token will be populated from the cache created by Connect-Verkada. +``` + +### EXAMPLE 3 +``` +Import-CSV ./file_ofLicenses.csv | Remove-VerkadaLPoI +The token will be populated from the cache created by Connect-Verkada. +``` + +### EXAMPLE 4 +``` +Remove-VerkadaCameraLicensePlateOfInterest -license_plate 'ABC123' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +The token is submitted as a parameter in the call. +``` + +## PARAMETERS + +### -license_plate +The license plate number of the License Plate of Interest + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: True (ByPropertyName) +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: (All) +Aliases: + +Required: False +Position: Named +Default value: $Global:verkadaConnection.x_verkada_auth_api +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -region +The region of the public API to be used + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: Api +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -errorsToFile +Switch to write errors to file + +```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 + +[https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Remove-VerkadaCameraLicensePlateOfInterest.md](https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Remove-VerkadaCameraLicensePlateOfInterest.md) + diff --git a/docs/function-documentation/Remove-VerkadaCommandUser.md b/docs/function-documentation/Remove-VerkadaCommandUser.md index 53a7d2c..89dcd26 100644 --- a/docs/function-documentation/Remove-VerkadaCommandUser.md +++ b/docs/function-documentation/Remove-VerkadaCommandUser.md @@ -13,27 +13,26 @@ Deletes a user from Command in an organization using https://apidocs.verkada.com ## SYNTAX ``` -Remove-VerkadaCommandUser [[-userId] ] [[-externalId] ] [[-org_id] ] - [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] [-ProgressAction ] - [] +Remove-VerkadaCommandUser [[-userId] ] [[-externalId] ] [[-x_verkada_auth_api] ] + [[-region] ] [-errorsToFile] [-ProgressAction ] [] ``` ## DESCRIPTION Deletes a user for an organization based on either provided user ID or an external ID set during creation. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Remove-VerkadaCommandUser -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -This will delete the Command user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will delete the Command user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` -Remove-VerkadaCommandUser -externalId 'newUserUPN@contoso.com' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This will delete the Command user with externalId newUserUPN@contoso.com. The org_id and tokens are submitted as parameters in the call. +Remove-VerkadaCommandUser -externalId 'newUserUPN@contoso.com' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This will delete the Command user with externalId newUserUPN@contoso.com. The token is submitted as a parameter in the call. ``` ## PARAMETERS @@ -68,21 +67,6 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -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 @@ -92,7 +76,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 4 +Position: 3 Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: False Accept wildcard characters: False @@ -107,7 +91,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 5 +Position: 4 Default value: Api Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/function-documentation/Remove-VerkadaHelixEvent.md b/docs/function-documentation/Remove-VerkadaHelixEvent.md index b272ba0..cdb4272 100644 --- a/docs/function-documentation/Remove-VerkadaHelixEvent.md +++ b/docs/function-documentation/Remove-VerkadaHelixEvent.md @@ -13,47 +13,32 @@ Deletes a Helix event using https://apidocs.verkada.com/reference/deletevideotag ## SYNTAX ``` -Remove-VerkadaHelixEvent [[-org_id] ] [-camera_id] [-event_type_uid] - [[-timeStamp] ] [[-epoch_time] ] [[-x_verkada_auth_api] ] [[-region] ] - [-errorsToFile] [-ProgressAction ] [] +Remove-VerkadaHelixEvent [-camera_id] [-event_type_uid] [[-timeStamp] ] + [[-epoch_time] ] [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] + [-ProgressAction ] [] ``` ## DESCRIPTION This method can be used to delete a Helix event from Command. The required parameter to successfully delete a Helix event are the associated Camera ID, API Token with Helix permissions, Event Type UID, and the exact event epoch time in milliseconds. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Remove-VerkadaHelixEvent -camera_id 6b8731d7-d991-4206-ba71-b5446fa617fc -event_type_uid cf918b16-26cd-4c01-a672-5a91b79311e1 -timeStamp '1/1/2025 08:35:00 -06' -This will delete the helix event for Jan 1, 2025 at 8:35 AM CST for the sepcified camera, and event ID. The org_id and token will be populated from the cached created by Connect-Verkada. +This will delete the helix event for Jan 1, 2025 at 8:35 AM CST for the sepcified camera, and event ID. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` -Remove-VerkadaHelixEvent -camera_id 6b8731d7-d991-4206-ba71-b5446fa617fc -event_type_uid cf918b16-26cd-4c01-a672-5a91b79311e1 -timeStamp '1/1/2025 08:35:00 -06' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This will delete the helix event for Jan 1, 2025 at 8:35 AM CST for the sepcified camera, and event ID. The org_id and token are submitted as parameters in the call. +Remove-VerkadaHelixEvent -camera_id 6b8731d7-d991-4206-ba71-b5446fa617fc -event_type_uid cf918b16-26cd-4c01-a672-5a91b79311e1 -timeStamp '1/1/2025 08:35:00 -06' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This will delete the helix event for Jan 1, 2025 at 8:35 AM CST for the sepcified camera, and event ID. The token is submitted as a parameter in the call. ``` ## PARAMETERS -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 1 -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - ### -camera_id The UUID of the camera who's name is being changed @@ -63,7 +48,7 @@ Parameter Sets: (All) Aliases: cameraId Required: True -Position: 2 +Position: 1 Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False @@ -78,7 +63,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 3 +Position: 2 Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False @@ -93,7 +78,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 4 +Position: 3 Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False @@ -108,7 +93,7 @@ Parameter Sets: (All) Aliases: time_ms Required: False -Position: 5 +Position: 4 Default value: 0 Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False @@ -123,7 +108,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 6 +Position: 5 Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: False Accept wildcard characters: False @@ -138,7 +123,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 7 +Position: 6 Default value: Api Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/function-documentation/Send-VerkadaPassInvite.md b/docs/function-documentation/Send-VerkadaPassInvite.md index a425937..906dfd3 100644 --- a/docs/function-documentation/Send-VerkadaPassInvite.md +++ b/docs/function-documentation/Send-VerkadaPassInvite.md @@ -13,33 +13,33 @@ Send a Verkada Pass email invited to an Access user in an organization using htt ## SYNTAX ``` -Send-VerkadaPassInvite [[-userId] ] [[-externalId] ] [-activateBLE] [[-org_id] ] +Send-VerkadaPassInvite [[-userId] ] [[-externalId] ] [-activateBLE] [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] [-ProgressAction ] [] ``` ## DESCRIPTION Given the user defined External ID or Verkada defined User ID (but not both) and the Organization ID, send out a Pass App invite. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Send-VerkadaPassInvite -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -This will send an email invite to an Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will send an email invite to an Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` Send-VerkadaPassInvite -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -activateBLE -This will send an email invite to an Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 and activate BLE unlocks. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will send an email invite to an Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 and activate BLE unlocks. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 3 ``` -Send-VerkadaPassInvite -externalId 'newUserUPN@contoso.com' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This will send an email invite to an Access user with -externalId 'newUserUPN@contoso.com'. The org_id and tokens are submitted as parameters in the call. +Send-VerkadaPassInvite -externalId 'newUserUPN@contoso.com' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This will send an email invite to an Access user with -externalId 'newUserUPN@contoso.com'. The token is submitted as a parameter in the call. ``` ## PARAMETERS @@ -89,21 +89,6 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -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 @@ -113,7 +98,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 4 +Position: 3 Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: False Accept wildcard characters: False @@ -128,7 +113,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 5 +Position: 4 Default value: Api Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/function-documentation/Set-VerkadaAccessUserBleUnlock.md b/docs/function-documentation/Set-VerkadaAccessUserBleUnlock.md index af132a5..96ac609 100644 --- a/docs/function-documentation/Set-VerkadaAccessUserBleUnlock.md +++ b/docs/function-documentation/Set-VerkadaAccessUserBleUnlock.md @@ -14,33 +14,33 @@ Activates an Access User's ability to use Bluetooth Unlock using https://apidocs ``` Set-VerkadaAccessUserBleUnlock [[-userId] ] [[-externalId] ] [-sendPassInvite] - [[-org_id] ] [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] - [-ProgressAction ] [] + [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] [-ProgressAction ] + [] ``` ## DESCRIPTION Given the user defined External ID or Verkada defined User ID (but not both), activate bluetooth unlock capability for a user. Response is updated Access Information Object. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Set-VerkadaAccessUserBleUnlock -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -This will activate the Access user's Bluetooth unlock ability with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will activate the Access user's Bluetooth unlock ability with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` Set-VerkadaAccessUserBleUnlock -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -sendPassInvite -This will activate the Access user's Bluetooth unlock ability with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 and send an email invite for the Pass app. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will activate the Access user's Bluetooth unlock ability with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 and send an email invite for the Pass app. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 3 ``` -Set-VerkadaAccessUserBleUnlock -externalId 'newUserUPN@contoso.com' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This will activate the Access user's Bluetooth unlock ability with externalId newUserUPN@contoso.com. The org_id and tokens are submitted as parameters in the call. +Set-VerkadaAccessUserBleUnlock -externalId 'newUserUPN@contoso.com' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This will activate the Access user's Bluetooth unlock ability with externalId newUserUPN@contoso.com. The token is submitted as a parameter in the call. ``` ## PARAMETERS @@ -90,21 +90,6 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -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 @@ -114,7 +99,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 4 +Position: 3 Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: False Accept wildcard characters: False @@ -129,7 +114,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 5 +Position: 4 Default value: Api Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/function-documentation/Set-VerkadaAccessUserEndDate.md b/docs/function-documentation/Set-VerkadaAccessUserEndDate.md index ac27531..4454af8 100644 --- a/docs/function-documentation/Set-VerkadaAccessUserEndDate.md +++ b/docs/function-documentation/Set-VerkadaAccessUserEndDate.md @@ -14,8 +14,8 @@ Sets the end date for an Access user's access in an organization using https://a ``` Set-VerkadaAccessUserEndDate [[-userId] ] [[-externalId] ] [[-endDate] ] - [[-org_id] ] [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] - [-ProgressAction ] [] + [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] [-ProgressAction ] + [] ``` ## DESCRIPTION @@ -23,20 +23,20 @@ Given the user defined External ID or Verkada defined User ID (but not both), se After this time, all methods of access will be revoked. End date value will be passed as a parameter in a json payload. Returns the updated Access Information Object. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Set-VerkadaAccessUserEndDate -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -endDate '11/28/2025 08:00 AM' -This sets the Access user's access to end at 8am on Nov 28, 2025 with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This sets the Access user's access to end at 8am on Nov 28, 2025 with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` -Set-VerkadaAccessUserEndDate -externalId 'newUserUPN@contoso.com' -endDate (Get-Date) -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This sets the Access user's access to end immediately since you are specifiying the current date and time with externalId newUserUPN@contoso.com. The org_id and tokens are submitted as parameters in the call. +Set-VerkadaAccessUserEndDate -externalId 'newUserUPN@contoso.com' -endDate (Get-Date) -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This sets the Access user's access to end immediately since you are specifiying the current date and time with externalId newUserUPN@contoso.com. The token is submitted as a parameter in the call. ``` ## PARAMETERS @@ -86,21 +86,6 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 4 -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -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 @@ -110,7 +95,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 5 +Position: 4 Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: False Accept wildcard characters: False @@ -125,7 +110,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 6 +Position: 5 Default value: Api Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/function-documentation/Set-VerkadaAccessUserEntryCode.md b/docs/function-documentation/Set-VerkadaAccessUserEntryCode.md index 4281275..c8fa724 100644 --- a/docs/function-documentation/Set-VerkadaAccessUserEntryCode.md +++ b/docs/function-documentation/Set-VerkadaAccessUserEntryCode.md @@ -14,27 +14,27 @@ Sets an entry code for an Access User in an organization using https://apidocs.v ``` Set-VerkadaAccessUserEntryCode [[-userId] ] [[-externalId] ] [[-entryCode] ] - [[-override] ] [[-org_id] ] [[-x_verkada_auth_api] ] [[-region] ] - [-errorsToFile] [-ProgressAction ] [] + [[-override] ] [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] + [-ProgressAction ] [] ``` ## DESCRIPTION Given the user defined External ID or Verkada defined User ID (but not both), set the entry code for a user. Entry code value will be passed as a parameter in a json payload.Returns the updated Access Information Object. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Set-VerkadaAccessUserEntryCode -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -entryCode '12345' -This will set an entry code of 12345 to the user specified. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will set an entry code of 12345 to the user specified. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` Set-VerkadaAccessUserEntryCode -externalId 'newUserUPN@contoso.com' -entryCode '12345' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This will set an entry code of 12345 to the user specified. The org_id and tokens are submitted as parameters in the call. +This will set an entry code of 12345 to the user specified. The token is submitted as a parameter in the call. ``` ## PARAMETERS @@ -100,21 +100,6 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 5 -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -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 @@ -124,7 +109,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 6 +Position: 5 Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: False Accept wildcard characters: False @@ -139,7 +124,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 7 +Position: 6 Default value: Api Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/function-documentation/Set-VerkadaAccessUserGroup.md b/docs/function-documentation/Set-VerkadaAccessUserGroup.md index a76e8f0..b07ee30 100644 --- a/docs/function-documentation/Set-VerkadaAccessUserGroup.md +++ b/docs/function-documentation/Set-VerkadaAccessUserGroup.md @@ -14,14 +14,14 @@ Adds an Access user to an Access group in an organization using https://apidocs. ### groupId (Default) ``` -Set-VerkadaAccessUserGroup [-userId ] [-externalId ] [-groupId ] [-org_id ] +Set-VerkadaAccessUserGroup [-userId ] [-externalId ] [-groupId ] [-x_verkada_auth_api ] [-region ] [-errorsToFile] [-ProgressAction ] [] ``` ### groupName ``` -Set-VerkadaAccessUserGroup [-userId ] [-externalId ] [-groupName ] [-org_id ] +Set-VerkadaAccessUserGroup [-userId ] [-externalId ] [-groupName ] [-x_verkada_auth_api ] [-region ] [-errorsToFile] [-ProgressAction ] [] ``` @@ -29,26 +29,26 @@ Set-VerkadaAccessUserGroup [-userId ] [-externalId ] [-groupName ## DESCRIPTION Add an access user to an access group with the Verkada defined Group ID and either the user defined External ID or the Verkada defined User ID.The Group ID is passed in as query parameter in the URL. The External ID or Verkada User ID(but not both) is passed in the json object in the body of the request. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Set-VerkadaAccessUserGroup -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -groupId '2d64e7de-fd95-48be-8b5c-7a23bde94f52' -This adds the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 to Access group with groupId 2d64e7de-fd95-48be-8b5c-7a23bde94f52. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This adds the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 to Access group with groupId 2d64e7de-fd95-48be-8b5c-7a23bde94f52. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` Set-VerkadaAccessUserGroup -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -groupName 'MyAccessGroup' -This adds the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 to Access group with groupName MyAccessGroup. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This adds the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 to Access group with groupName MyAccessGroup. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 3 ``` -Set-VerkadaAccessUserGroup -externalId 'newUserUPN@contoso.com' -groupId '2d64e7de-fd95-48be-8b5c-7a23bde94f52' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This adds the Access user uwith xternalId newUserUPN@contoso.com to Access group with groupId 2d64e7de-fd95-48be-8b5c-7a23bde94f52. The org_id and tokens are submitted as parameters in the call. +Set-VerkadaAccessUserGroup -externalId 'newUserUPN@contoso.com' -groupId '2d64e7de-fd95-48be-8b5c-7a23bde94f52' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This adds the Access user uwith xternalId newUserUPN@contoso.com to Access group with groupId 2d64e7de-fd95-48be-8b5c-7a23bde94f52. The token is submitted as a parameter in the call. ``` ## PARAMETERS @@ -113,21 +113,6 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -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 diff --git a/docs/function-documentation/Set-VerkadaAccessUserProfilePicture.md b/docs/function-documentation/Set-VerkadaAccessUserProfilePicture.md index 51d1865..17c91cf 100644 --- a/docs/function-documentation/Set-VerkadaAccessUserProfilePicture.md +++ b/docs/function-documentation/Set-VerkadaAccessUserProfilePicture.md @@ -14,27 +14,27 @@ Adds/replaces an Access user's profile picture in an organization using https:// ``` Set-VerkadaAccessUserProfilePicture [[-userId] ] [[-externalId] ] [[-imagePath] ] - [[-overwrite] ] [[-org_id] ] [[-x_verkada_auth_api] ] [[-region] ] - [-errorsToFile] [-ProgressAction ] [] + [[-overwrite] ] [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] + [-ProgressAction ] [] ``` ## DESCRIPTION This will set the Access user's, specified by the user_Id or external_ID, profile picture. This must be a png or jpeg/jpg format image. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Set-VerkadaAccessUserProfilePicture -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -imagePath './myPicture.jpg' -This sets the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 to use the picture specified at path ./myPicture.jpg. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This sets the Access user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 to use the picture specified at path ./myPicture.jpg. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` -Set-VerkadaAccessUserProfilePicture -externalId 'newUserUPN@contoso.com' -imagePath './myPicture.png' -overwrite $true -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This sets the Access user with externalId newUserUPN@contoso.com to use the picture specified at path ./myPicture.png and will overwrite the existing photo. The org_id and tokens are submitted as parameters in the call. +Set-VerkadaAccessUserProfilePicture -externalId 'newUserUPN@contoso.com' -imagePath './myPicture.png' -overwrite $true -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This sets the Access user with externalId newUserUPN@contoso.com to use the picture specified at path ./myPicture.png and will overwrite the existing photo. The token is submitted as a parameter in the call. ``` ## PARAMETERS @@ -99,21 +99,6 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 5 -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -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 @@ -123,7 +108,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 6 +Position: 5 Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: False Accept wildcard characters: False @@ -138,7 +123,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 7 +Position: 6 Default value: Api Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/function-documentation/Set-VerkadaAccessUserRemoteUnlock.md b/docs/function-documentation/Set-VerkadaAccessUserRemoteUnlock.md index e4ed0b2..286288d 100644 --- a/docs/function-documentation/Set-VerkadaAccessUserRemoteUnlock.md +++ b/docs/function-documentation/Set-VerkadaAccessUserRemoteUnlock.md @@ -13,27 +13,27 @@ Activates an Access User's ability to use Remote Unlock using https://apidocs.ve ## SYNTAX ``` -Set-VerkadaAccessUserRemoteUnlock [[-userId] ] [[-externalId] ] [[-org_id] ] +Set-VerkadaAccessUserRemoteUnlock [[-userId] ] [[-externalId] ] [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] [-ProgressAction ] [] ``` ## DESCRIPTION Given the user defined External ID or Verkada defined User ID (but not both) and the Organization Id, activate remote unlock capability for a user.Returns the updated Access Information Object. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Set-VerkadaAccessUserRemoteUnlock -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -This will activate the Access user's Remote unlock ability with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will activate the Access user's Remote unlock ability with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` -Set-VerkadaAccessUserRemoteUnlock -externalId 'newUserUPN@contoso.com' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This will activate the Access user's Remote unlock ability with externalId newUserUPN@contoso.com. The org_id and tokens are submitted as parameters in the call. +Set-VerkadaAccessUserRemoteUnlock -externalId 'newUserUPN@contoso.com' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This will activate the Access user's Remote unlock ability with externalId newUserUPN@contoso.com. The token is submitted as a parameter in the call. ``` ## PARAMETERS @@ -68,21 +68,6 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -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 @@ -92,7 +77,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 4 +Position: 3 Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: False Accept wildcard characters: False @@ -107,7 +92,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 5 +Position: 4 Default value: Api Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/function-documentation/Set-VerkadaAccessUserStartDate.md b/docs/function-documentation/Set-VerkadaAccessUserStartDate.md index ea9e80f..7ca165b 100644 --- a/docs/function-documentation/Set-VerkadaAccessUserStartDate.md +++ b/docs/function-documentation/Set-VerkadaAccessUserStartDate.md @@ -14,8 +14,8 @@ Sets the start date for an Access user's access in an organization using https:/ ``` Set-VerkadaAccessUserStartDate [[-userId] ] [[-externalId] ] [[-startDate] ] - [[-org_id] ] [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] - [-ProgressAction ] [] + [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] [-ProgressAction ] + [] ``` ## DESCRIPTION @@ -23,20 +23,20 @@ Given the user defined External ID or Verkada defined User ID (but not both), se Before this time, all methods of access specified for this access user will invalid. Start date value will be passed as a parameter in a json payload. Returns the updated Access Information Object. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Set-VerkadaAccessUserStartDate -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -startDate '1/28/2022 08:00 AM' -This sets the Access user's access to start at 8am on Jan 28, 2022 with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This sets the Access user's access to start at 8am on Jan 28, 2022 with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` -Set-VerkadaAccessUserStartDate -externalId 'newUserUPN@contoso.com' -startDate (Get-Date) -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This sets the Access user's access to start immediately since you are specifiying the current date and time with externalId newUserUPN@contoso.com. The org_id and tokens are submitted as parameters in the call. +Set-VerkadaAccessUserStartDate -externalId 'newUserUPN@contoso.com' -startDate (Get-Date) -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This sets the Access user's access to start immediately since you are specifiying the current date and time with externalId newUserUPN@contoso.com. The token is submitted as a parameter in the call. ``` ## PARAMETERS @@ -86,21 +86,6 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 4 -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -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 @@ -110,7 +95,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 5 +Position: 4 Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: False Accept wildcard characters: False @@ -125,7 +110,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 6 +Position: 5 Default value: Api Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/function-documentation/Set-VerkadaCameraCloudBackupSettings.md b/docs/function-documentation/Set-VerkadaCameraCloudBackupSettings.md new file mode 100644 index 0000000..3c4e417 --- /dev/null +++ b/docs/function-documentation/Set-VerkadaCameraCloudBackupSettings.md @@ -0,0 +1,233 @@ +--- +external help file: verkadaModule-help.xml +Module Name: verkadaModule +online version: https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Set-VerkadaCameraCloudBackupSettings.md +schema: 2.0.0 +--- + +# Set-VerkadaCameraCloudBackupSettings + +## SYNOPSIS +This updates the cloud backup settings for a camera using https://apidocs.verkada.com/reference/postcloudbackupviewv1 + +## SYNTAX + +``` +Set-VerkadaCameraCloudBackupSettings [-camera_id] -days_to_preserve -enabled + -time_to_preserve -upload_timeslot -video_quality -video_to_upload + [-x_verkada_auth_api ] [-region ] [-errorsToFile] [-ProgressAction ] + [] +``` + +## DESCRIPTION +This function set the cloud back settings for a camera or cameras. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. + +## EXAMPLES + +### EXAMPLE 1 +``` +Set-VerkadaCameraCloudBackupSettings -enabled 1 -upload_timeslot '0,86400' -time_to_preserve '25200,68400' -days_to_preserve '1,1,1,1,1,1,1' -video_to_upload 'ALL' -video_quality 'STANDARD_QUALITY' -camera_id 'cwdfwfw-3f3-cwdf2-cameraId' +This will set the camera cwdfwfw-3f3-cwdf2-cameraId to use cloud backup with the submitted settings. The token will be populated from the cache created by Connect-Verkada. +``` + +### EXAMPLE 2 +``` +Set-VerkadaCameraCloudBackupSettings -enabled 1 -upload_timeslot '0,86400' -time_to_preserve '25200,68400' -days_to_preserve '1,1,1,1,1,1,1' -video_to_upload 'ALL' -video_quality 'STANDARD_QUALITY' -camera_id 'cwdfwfw-3f3-cwdf2-cameraId' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This will set the camera cwdfwfw-3f3-cwdf2-cameraId to use cloud backup with the submitted settings. The token is submitted as a parameter in the call. +``` + +### EXAMPLE 3 +``` +import-Csv ./cameras.csv | Set-VerkadaCameraCloudBackupSettings +This will set the camera cloud backup settings for all the rows in the CSV which contains all needed params. The token will be populated from the cache created by Connect-Verkada. +``` + +## PARAMETERS + +### -camera_id +The UUID of the camera who's cloud backup seetings are being changed + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -days_to_preserve +Delimited list of booleans indicating which days footage should be uploaded. +The elements in the array indicate the following days in order: Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday. +If value is 1, cloud backup is on for that day. +If value is 0, cloud backup is off for that day. +For example, 0,1,1,1,1,1,0 means only backup on weekdays. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -enabled +Status of cloud backup for a camera. +If value is 1, cloud backup is enabled. +If value is 0, cloud backup is disabled. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: 0 +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -time_to_preserve +Delimited list of start_time, end_time as timeslot for which a user wants footage to be backed up to the cloud, start_time and end_time are integers indicating seconds to midnight, i.e, 3600,7200 means 1am - 2am + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -upload_timeslot +Delimited list of start_time, end_time as timeslot for scheduled time for footage upload, start_time and end_time are integers indicating seconds to midnight, i.e, 3600,7200 means 1am - 2am + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -video_quality +Quality of the uploaded video. +Two values are possible: STANDARD_QUALITY and HIGH_QUALITY. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -video_to_upload +The type of video that is backed-up. +Two values are possible: MOTION and ALL. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +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: (All) +Aliases: + +Required: False +Position: Named +Default value: $Global:verkadaConnection.x_verkada_auth_api +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -region +The region of the public API to be used + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: Api +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -errorsToFile +Switch to write errors to file + +```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 + +[https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Set-VerkadaCameraCloudBackupSettings.md](https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Set-VerkadaCameraCloudBackupSettings.md) + diff --git a/docs/function-documentation/Set-VerkadaCameraLicensePlateOfInterest.md b/docs/function-documentation/Set-VerkadaCameraLicensePlateOfInterest.md new file mode 100644 index 0000000..1403864 --- /dev/null +++ b/docs/function-documentation/Set-VerkadaCameraLicensePlateOfInterest.md @@ -0,0 +1,155 @@ +--- +external help file: verkadaModule-help.xml +Module Name: verkadaModule +online version: https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Set-VerkadaCameraLicensePlateOfInterest.md +schema: 2.0.0 +--- + +# Set-VerkadaCameraLicensePlateOfInterest + +## SYNOPSIS +Updates a License Plate of Interest for an organization using https://apidocs.verkada.com/reference/patchlicenseplateofinterestviewv1 + +## SYNTAX + +``` +Set-VerkadaCameraLicensePlateOfInterest [-license_plate] [-description] + [-x_verkada_auth_api ] [-region ] [-errorsToFile] [-ProgressAction ] + [] +``` + +## DESCRIPTION +Updates a license plate description from License Plates of Interest using a specified license plate number. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. + +## EXAMPLES + +### EXAMPLE 1 +``` +Set-VerkadaCameraLicensePlateOfInterest -license_plate 'ABC123' -description 'New License Plate Descriptionv2' +The token will be populated from the cache created by Connect-Verkada. +``` + +### EXAMPLE 2 +``` +Set-VerkadaLPoI 'ABC123' 'New License Plate Descriptionv2' +The token will be populated from the cache created by Connect-Verkada. +``` + +### EXAMPLE 3 +``` +Import-CSV ./file_ofLicenses_and_Descriptions.csv | Set-VerkadaLPoI +The token will be populated from the cache created by Connect-Verkada. +``` + +### EXAMPLE 4 +``` +Set-VerkadaCameraLicensePlateOfInterest -license_plate 'ABC123' -description 'New License Plate Descriptionv2' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +The token is submitted as a parameter in the call. +``` + +## PARAMETERS + +### -license_plate +The license plate number of the License Plate of Interest + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -description +The description for the License Plate of Interest + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: True (ByPropertyName) +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: (All) +Aliases: + +Required: False +Position: Named +Default value: $Global:verkadaConnection.x_verkada_auth_api +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -region +The region of the public API to be used + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: Api +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -errorsToFile +Switch to write errors to file + +```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 + +[https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Set-VerkadaCameraLicensePlateOfInterest.md](https://github.com/bepsoccer/verkadaModule/blob/master/docs/function-documentation/Set-VerkadaCameraLicensePlateOfInterest.md) + diff --git a/docs/function-documentation/Set-VerkadaCommandUser.md b/docs/function-documentation/Set-VerkadaCommandUser.md index 42e423b..101ae30 100644 --- a/docs/function-documentation/Set-VerkadaCommandUser.md +++ b/docs/function-documentation/Set-VerkadaCommandUser.md @@ -16,44 +16,44 @@ Sets the user details for a Command User in an organization using https://apidoc Set-VerkadaCommandUser [[-userId] ] [[-email] ] [[-firstName] ] [[-middleName] ] [[-lastName] ] [[-externalId] ] [[-companyName] ] [[-department] ] [[-departmentId] ] [[-employeeId] ] [[-employeeType] ] - [[-employeeTitle] ] [[-phone] ] [[-org_id] ] [[-x_verkada_auth_api] ] - [[-region] ] [-errorsToFile] [-ProgressAction ] [] + [[-employeeTitle] ] [[-phone] ] [[-x_verkada_auth_api] ] [[-region] ] + [-errorsToFile] [-ProgressAction ] [] ``` ## DESCRIPTION Updates a user's metadata for an organization based on either provided user ID or an external ID set during creation. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Set-VerkadaCommandUser -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -firstName 'New' -lastName 'User' -This will update the Command user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 with the name "New User". The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will update the Command user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 with the name "New User". The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` -Set-VerkadaCommandUser -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -firstName 'New' -lastName 'User' -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This will update the Command user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 with the name "New User". The org_id and tokens are submitted as parameters in the call. +Set-VerkadaCommandUser -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -firstName 'New' -lastName 'User' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This will update the Command user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 with the name "New User". The token is submitted as a parameter in the call. ``` ### EXAMPLE 3 ``` Set-VerkadaCommandUser -externalId 'newUserUPN@contoso.com' -email 'newUser@contoso.com' -This will update the Command user with externalId newUserUPN@contoso.com with the email newUser@contoso.com. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will update the Command user with externalId newUserUPN@contoso.com with the email newUser@contoso.com. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 4 ``` Set-VerkadaCommandUser -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -externalId 'newUserUPN@contoso.com' -This will update the Command user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 to have the new externalId newUPN@contoso.com. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will update the Command user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 to have the new externalId newUPN@contoso.com. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 5 ``` Set-VerkadaCommandUser -userId '801c9551-b04c-4293-84ad-b0a6aa0588b3' -firstName 'New' -lastName 'User' -email 'newUser@contoso.com -companyName 'Contoso' -department 'sales' -departmentId 'US-Sales' -employeeId '12345' -employeeTitle 'The Closer' -employeeType 'Full Time' -phone '+18165556789' -This will update the Command user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 to the name "New User" and email newUser@contoso.com in department defined as sales with departmnetId of US-Sales with the appropriate companyName, employeeID, employeeTitle, employeeType and phone. The org_id and tokens will be populated from the cached created by Connect-Verkada. +This will update the Command user with userId 801c9551-b04c-4293-84ad-b0a6aa0588b3 to the name "New User" and email newUser@contoso.com in department defined as sales with departmnetId of US-Sales with the appropriate companyName, employeeID, employeeTitle, employeeType and phone. The token will be populated from the cache created by Connect-Verkada. ``` ## PARAMETERS @@ -253,21 +253,6 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 14 -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -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 @@ -277,7 +262,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 15 +Position: 14 Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: False Accept wildcard characters: False @@ -292,7 +277,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 16 +Position: 15 Default value: Api Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/function-documentation/Set-VerkadaHelixEvent.md b/docs/function-documentation/Set-VerkadaHelixEvent.md index 0ad9ca3..ec025df 100644 --- a/docs/function-documentation/Set-VerkadaHelixEvent.md +++ b/docs/function-documentation/Set-VerkadaHelixEvent.md @@ -13,49 +13,33 @@ Updates a Helix event using https://apidocs.verkada.com/reference/patchvideotagg ## SYNTAX ``` -Set-VerkadaHelixEvent [[-org_id] ] [-camera_id] [-event_type_uid] - [[-timeStamp] ] [[-epoch_time] ] [-attributes] [[-flagged] ] - [[-x_verkada_auth_api] ] [[-region] ] [-errorsToFile] [-ProgressAction ] - [] +Set-VerkadaHelixEvent [-camera_id] [-event_type_uid] [[-timeStamp] ] + [[-epoch_time] ] [-attributes] [[-flagged] ] [[-x_verkada_auth_api] ] + [[-region] ] [-errorsToFile] [-ProgressAction ] [] ``` ## DESCRIPTION This method can be used to update a Helix Event that has already been posted to Command. This is especially useful if a user needs to add an additional attribute key to the existing event, along with its new corresponding value. To successfully update a Helix Event, users will need to input the associated Camera ID, API Token with Helix permissions, Event Type UID, exact event epoch time in milliseconds, as well as the new attribute key and attribute value that is being updated. -The org_id and reqired token 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. +The reqired token can be directly submitted as a parameter, but is much easier to use Connect-Verkada to cache this information ahead of time and for subsequent commands. ## EXAMPLES ### EXAMPLE 1 ``` Get-VerkadaHelixEvent -camera_id 6b8731d7-d991-4206-ba71-b5446fa617fc -event_type_uid cf918b16-26cd-4c01-a672-5a91b79311e1 -timeStamp '1/1/2025 08:35:00 -06' -attributes $attributes -This will get the helix event for Jan 1, 2025 at 8:35 AM CST for the sepcified camera, event ID, and submitted attributes. The org_id and token will be populated from the cached created by Connect-Verkada. +This will get the helix event for Jan 1, 2025 at 8:35 AM CST for the sepcified camera, event ID, and submitted attributes. The token will be populated from the cache created by Connect-Verkada. ``` ### EXAMPLE 2 ``` -Get-VerkadaHelixEvent -camera_id 6b8731d7-d991-4206-ba71-b5446fa617fc -event_type_uid cf918b16-26cd-4c01-a672-5a91b79311e1 -timeStamp '1/1/2025 08:35:00 -06' -attributes $attributes -org_id '7cd47706-f51b-4419-8675-3b9f0ce7c12d' -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' -This will get the helix event for Jan 1, 2025 at 8:35 AM CST for the sepcified camera, event ID, and submitted attributes. The org_id and token are submitted as parameters in the call. +Get-VerkadaHelixEvent -camera_id 6b8731d7-d991-4206-ba71-b5446fa617fc -event_type_uid cf918b16-26cd-4c01-a672-5a91b79311e1 -timeStamp '1/1/2025 08:35:00 -06' -attributes $attributes -x_verkada_auth_api 'sd78ds-uuid-of-verkada-token' +This will get the helix event for Jan 1, 2025 at 8:35 AM CST for the sepcified camera, event ID, and submitted attributes. The token is submitted as a parameter in the call. ``` ## PARAMETERS -### -org_id -The UUID of the organization the user belongs to - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 1 -Default value: $Global:verkadaConnection.org_id -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - ### -camera_id The UUID of the camera who's name is being changed @@ -65,7 +49,7 @@ Parameter Sets: (All) Aliases: cameraId Required: True -Position: 2 +Position: 1 Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False @@ -80,7 +64,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 3 +Position: 2 Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False @@ -95,7 +79,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 4 +Position: 3 Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False @@ -110,7 +94,7 @@ Parameter Sets: (All) Aliases: time_ms Required: False -Position: 5 +Position: 4 Default value: 0 Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False @@ -125,7 +109,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 6 +Position: 5 Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False @@ -140,7 +124,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 7 +Position: 6 Default value: False Accept pipeline input: False Accept wildcard characters: False @@ -155,7 +139,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 8 +Position: 7 Default value: $Global:verkadaConnection.x_verkada_auth_api Accept pipeline input: False Accept wildcard characters: False @@ -170,7 +154,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 9 +Position: 8 Default value: Api Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/reference.md b/docs/reference.md index bb6b8ac..98d061c 100644 --- a/docs/reference.md +++ b/docs/reference.md @@ -6,10 +6,10 @@ * [Add-VerkadaAccessUserLicensePlate](function-documentation/Add-VerkadaAccessUserLicensePlate.md) * [Add-VerkadaAccessUserMfaCode](function-documentation/Add-VerkadaAccessUserMfaCode.md) * [Add-VerkadaCamera](function-documentation/Add-VerkadaCamera.md) +* [Add-VerkadaCameraLicensePlateOfInterest](function-documentation/Add-VerkadaCameraLicensePlateOfInterest.md) * [Add-VerkadaCommandSite](function-documentation/Add-VerkadaCommandSite.md) * [Add-VerkadaCommandUser](function-documentation/Add-VerkadaCommandUser.md) * [Add-VerkadaHelixEvent](function-documentation/Add-VerkadaHelixEvent.md) -* [Add-VerkadaLicensePlateOfInterest](function-documentation/Add-VerkadaLicensePlateOfInterest.md) * [Add-VerkadaWorkplaceEmployee](function-documentation/Add-VerkadaWorkplaceEmployee.md) * [Connect-Verkada](function-documentation/Connect-Verkada.md) * [Disable-VerkadaAccessUserCard](function-documentation/Disable-VerkadaAccessUserCard.md) @@ -36,10 +36,10 @@ * [Get-VerkadaAlarmsDevices](function-documentation/Get-VerkadaAlarmsDevices.md) * [Get-VerkadaAlarmsSiteConfig](function-documentation/Get-VerkadaAlarmsSiteConfig.md) * [Get-VerkadaAlarmsSiteContacts](function-documentation/Get-VerkadaAlarmsSiteContacts.md) +* [Get-VerkadaCameraCloudBackupSettings](function-documentation/Get-VerkadaCameraCloudBackupSettings.md) * [Get-VerkadaCameraConfig](function-documentation/Get-VerkadaCameraConfig.md) * [Get-VerkadaCameraGroup](function-documentation/Get-VerkadaCameraGroup.md) * [Get-VerkadaCameras](function-documentation/Get-VerkadaCameras.md) -* [Get-VerkadaCloudBackupSettings](function-documentation/Get-VerkadaCloudBackupSettings.md) * [Get-VerkadaCommandUser](function-documentation/Get-VerkadaCommandUser.md) * [Get-VerkadaHelixEvent](function-documentation/Get-VerkadaHelixEvent.md) * [Get-VerkadaLicensePlatesOfInterest](function-documentation/Get-VerkadaLicensePlatesOfInterest.md) @@ -63,9 +63,9 @@ * [Remove-VerkadaAccessUserProfilePicture](function-documentation/Remove-VerkadaAccessUserProfilePicture.md) * [Remove-VerkadaAccessUserRemoteUnlock](function-documentation/Remove-VerkadaAccessUserRemoteUnlock.md) * [Remove-VerkadaCameraArchive](function-documentation/Remove-VerkadaCameraArchive.md) +* [Remove-VerkadaCameraLicensePlateOfInterest](function-documentation/Remove-VerkadaCameraLicensePlateOfInterest.md) * [Remove-VerkadaCommandUser](function-documentation/Remove-VerkadaCommandUser.md) * [Remove-VerkadaHelixEvent](function-documentation/Remove-VerkadaHelixEvent.md) -* [Remove-VerkadaLicensePlateOfInterest](function-documentation/Remove-VerkadaLicensePlateOfInterest.md) * [Remove-VerkadaWorkplaceEmployee](function-documentation/Remove-VerkadaWorkplaceEmployee.md) * [Send-VerkadaPassInvite](function-documentation/Send-VerkadaPassInvite.md) * [Set-VerkadaAccessDoorName](function-documentation/Set-VerkadaAccessDoorName.md) @@ -81,15 +81,15 @@ * [Set-VerkadaAccessUserStartDate](function-documentation/Set-VerkadaAccessUserStartDate.md) * [Set-VerkadaAlarmsDoorSensorSettings](function-documentation/Set-VerkadaAlarmsDoorSensorSettings.md) * [Set-VerkadaAlarmsPanicButtonSettings](function-documentation/Set-VerkadaAlarmsPanicButtonSettings.md) +* [Set-VerkadaCameraCloudBackupSettings](function-documentation/Set-VerkadaCameraCloudBackupSettings.md) +* [Set-VerkadaCameraLicensePlateOfInterest](function-documentation/Set-VerkadaCameraLicensePlateOfInterest.md) * [Set-VerkadaCameraName](function-documentation/Set-VerkadaCameraName.md) * [Set-VerkadaCameraOrientation](function-documentation/Set-VerkadaCameraOrientation.md) * [Set-VerkadaCameraSite](function-documentation/Set-VerkadaCameraSite.md) * [Set-VerkadaCameraTamperSensitivity](function-documentation/Set-VerkadaCameraTamperSensitivity.md) -* [Set-VerkadaCloudBackupSettings](function-documentation/Set-VerkadaCloudBackupSettings.md) * [Set-VerkadaCommandPermissions](function-documentation/Set-VerkadaCommandPermissions.md) * [Set-VerkadaCommandUser](function-documentation/Set-VerkadaCommandUser.md) * [Set-VerkadaHelixEvent](function-documentation/Set-VerkadaHelixEvent.md) -* [Set-VerkadaLicensePlateOfInterest](function-documentation/Set-VerkadaLicensePlateOfInterest.md) * [Set-VerkadaSitePermissions](function-documentation/Set-VerkadaSitePermissions.md) * [Set-VerkadaWorkplaceEmployee](function-documentation/Set-VerkadaWorkplaceEmployee.md) * [Unlock-VerkadaAccessDoor](function-documentation/Unlock-VerkadaAccessDoor.md) diff --git a/verkadaModule/verkadaModule.psd1 b/verkadaModule/verkadaModule.psd1 index 7806761..dc816fc 100644 --- a/verkadaModule/verkadaModule.psd1 +++ b/verkadaModule/verkadaModule.psd1 @@ -3,7 +3,7 @@ # # Generated by: Verkada SE Community # -# Generated on: 10/23/2025 +# Generated on: 10/24/2025 # @{ @@ -12,7 +12,7 @@ RootModule = 'verkadaModule.psm1' # Version number of this module. -ModuleVersion = '0.9.11' +ModuleVersion = '0.10.0' # Supported PSEditions CompatiblePSEditions = 'Desktop', 'Core'