Skip to content

Commit 34b564c

Browse files
committed
Refactor log output object and standard info fields
Renamed 'Standard' field to 'Template' in $StandardInfo and added 'Standard' from $Row. Changed output object field 'Standard' to 'StandardInfo' for clarity and consistency.
1 parent aae0b44 commit 34b564c

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

Modules/CIPPCore/Public/Entrypoints/Invoke-ListLogs.ps1

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ function Invoke-ListLogs {
3838
$Standard = ($Templates | Where-Object { $_.RowKey -eq $Row.StandardTemplateId }).JSON | ConvertFrom-Json
3939

4040
$StandardInfo = @{
41-
Standard = $Standard.templateName
41+
Template = $Standard.templateName
42+
Standard = $Row.Standard
4243
}
4344

4445
if ($Row.IntuneTemplateId) {
@@ -129,7 +130,8 @@ function Invoke-ListLogs {
129130
$Standard = ($Templates | Where-Object { $_.RowKey -eq $Row.StandardTemplateId }).JSON | ConvertFrom-Json
130131

131132
$StandardInfo = @{
132-
Standard = $Standard.templateName
133+
Template = $Standard.templateName
134+
Standard = $Row.Standard
133135
}
134136

135137
if ($Row.IntuneTemplateId) {
@@ -148,22 +150,22 @@ function Invoke-ListLogs {
148150
$Row.LogData | ConvertFrom-Json
149151
} else { $Row.LogData }
150152
[PSCustomObject]@{
151-
DateTime = $Row.Timestamp
152-
Tenant = $Row.Tenant
153-
API = $Row.API
154-
Message = $Row.Message
155-
User = $Row.Username
156-
Severity = $Row.Severity
157-
LogData = $LogData
158-
TenantID = if ($Row.TenantID -ne $null) {
153+
DateTime = $Row.Timestamp
154+
Tenant = $Row.Tenant
155+
API = $Row.API
156+
Message = $Row.Message
157+
User = $Row.Username
158+
Severity = $Row.Severity
159+
LogData = $LogData
160+
TenantID = if ($Row.TenantID -ne $null) {
159161
$Row.TenantID
160162
} else {
161163
'None'
162164
}
163-
AppId = $Row.AppId
164-
IP = $Row.IP
165-
RowKey = $Row.RowKey
166-
Standard = $StandardInfo
165+
AppId = $Row.AppId
166+
IP = $Row.IP
167+
RowKey = $Row.RowKey
168+
StandardInfo = $StandardInfo
167169
}
168170
}
169171
}

0 commit comments

Comments
 (0)