Skip to content

Commit

Permalink
Adding view query param
Browse files Browse the repository at this point in the history
Corrects display issues in the list templates page
  • Loading branch information
DChorn-ANS authored Jul 30, 2023
1 parent 38ac3c8 commit e37fe12
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ListIntuneTemplates/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ $Templates = Get-ChildItem "Config\*.IntuneTemplate.json" | ForEach-Object {
$Table = Get-CippTable -tablename 'templates'
$Filter = "PartitionKey eq 'IntuneTemplate'"
$Templates = (Get-AzDataTableEntity @Table -Filter $Filter).JSON | ConvertFrom-Json
if ($Request.query.View) {
$Templates = $Templates | ForEach-Object {
$data = $_.RAWJson | ConvertFrom-Json
$data | Add-Member -NotePropertyName "displayName" -NotePropertyValue $_.Displayname
$data | Add-Member -NotePropertyName "description" -NotePropertyValue $_.Description
$data | Add-Member -NotePropertyName "Type" -NotePropertyValue $_.Type
$data | Add-Member -NotePropertyName "GUID" -NotePropertyValue $_.GUID
$data
}
}

if ($Request.query.ID) { $Templates = $Templates | Where-Object -Property guid -EQ $Request.query.id }

Expand Down

0 comments on commit e37fe12

Please sign in to comment.