Skip to content

Updated Set-DrmmDeviceUdf for support of all udf values#54

Open
CasperStekelenburg wants to merge 1 commit into
aaronengels:masterfrom
CasperStekelenburg:master
Open

Updated Set-DrmmDeviceUdf for support of all udf values#54
CasperStekelenburg wants to merge 1 commit into
aaronengels:masterfrom
CasperStekelenburg:master

Conversation

@CasperStekelenburg
Copy link
Copy Markdown

Datto has updated the number of UDF's to 300, so I updated the function to reflect that.

Copilot AI review requested due to automatic review settings May 20, 2026 14:53
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Set-DrmmDeviceUdf to support Datto RMM’s expanded Device UDF range (up to udf300) by moving from individually declared UDF parameters to a key/value input model with validation.

Changes:

  • Reworks the cmdlet interface to accept UDF updates via -UdfData (hashtable/object) rather than -udf1..-udf30.
  • Adds validation for UDF key format/range and converts empty-string values to null in the API payload.
  • Adds SupportsShouldProcess/WhatIf support and updates help text/examples.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

}

foreach ($Entry in $UdfEnumerator) {
$Key = [string]$Entry.Name
Comment thread functions/Set-DrmmDeviceUdf.ps1
Comment on lines +29 to +31
[CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'Medium')]
[OutputType([psobject])]
param(
return New-ApiRequest -apiMethod $ApiMethod -apiRequest "/v2/device/$DeviceUid/udf" -apiRequestBody $Body
}
} catch {
Write-Error $_
Comment on lines +31 to +39
param(
[Parameter(Mandatory = $true, HelpMessage = "Provide device uid which will be used to set UDF(s)")]
[ValidateNotNullOrEmpty()]
[string]$DeviceUid,

[Parameter(Mandatory = $false, HelpMessage = "Provide UDF key/value pairs, for example @{ udf1 = 'Value'; udf300 = '' }")]
[ValidateNotNull()]
[object]$UdfData
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants