Skip to content

Commit 93aa351

Browse files
report max length.
1 parent 4b6aa7c commit 93aa351

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Invoke-AddTestReport.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ function Invoke-AddTestReport {
1818
if ([string]::IsNullOrEmpty($Body.name)) {
1919
throw 'Report name is required'
2020
}
21+
if ($Body.name.Length -gt 256) {
22+
throw 'Report name must be 256 characters or fewer'
23+
}
2124

2225
$IsUpdate = -not [string]::IsNullOrWhiteSpace([string]$Body.ReportId)
2326
$ReportTable = Get-CippTable -tablename 'CippReportTemplates'

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tools/Invoke-ExecReportBuilderTemplate.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ function Invoke-ExecReportBuilderTemplate {
2222
if ([string]::IsNullOrEmpty($Body.Name)) {
2323
throw 'Template name is required'
2424
}
25+
if ($Body.Name.Length -gt 256) {
26+
throw 'Template name must be 256 characters or fewer'
27+
}
2528

2629
$GUID = if ($Body.GUID) { $Body.GUID } else { (New-Guid).GUID }
2730
$JSON = ConvertTo-Json -InputObject @{

0 commit comments

Comments
 (0)