From 30af70b9a6771d321e51defd386f9f665cb3c552 Mon Sep 17 00:00:00 2001 From: Daniel Hughes Date: Mon, 28 Oct 2024 09:46:53 +0000 Subject: [PATCH] Fix HQRM --- source/Private/Get-ClassPropertyCustomAttribute.ps1 | 8 +++++--- source/Private/Get-DscPropertyType.ps1 | 2 +- source/Private/Get-DscResourceSchemaPropertyContent.ps1 | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/source/Private/Get-ClassPropertyCustomAttribute.ps1 b/source/Private/Get-ClassPropertyCustomAttribute.ps1 index 402381f..e69b407 100644 --- a/source/Private/Get-ClassPropertyCustomAttribute.ps1 +++ b/source/Private/Get-ClassPropertyCustomAttribute.ps1 @@ -1,4 +1,5 @@ -function Get-ClassPropertyCustomAttribute { +function Get-ClassPropertyCustomAttribute +{ [CmdletBinding()] param ( [Parameter(Mandatory = $true)] @@ -10,7 +11,8 @@ function Get-ClassPropertyCustomAttribute { $AttributeType ) - process { - return $Attributes | Where-Object {$_.AttributeType.Name -eq $AttributeType} + process + { + return $Attributes | Where-Object { $_.AttributeType.Name -eq $AttributeType } } } diff --git a/source/Private/Get-DscPropertyType.ps1 b/source/Private/Get-DscPropertyType.ps1 index e1f7b50..f690007 100644 --- a/source/Private/Get-DscPropertyType.ps1 +++ b/source/Private/Get-DscPropertyType.ps1 @@ -23,7 +23,7 @@ function Get-DscPropertyType { return $PropertyType.GenericTypeArguments.Name } - Default + default { return $PropertyType.Name } diff --git a/source/Private/Get-DscResourceSchemaPropertyContent.ps1 b/source/Private/Get-DscResourceSchemaPropertyContent.ps1 index 1650b4e..494f7e8 100644 --- a/source/Private/Get-DscResourceSchemaPropertyContent.ps1 +++ b/source/Private/Get-DscResourceSchemaPropertyContent.ps1 @@ -59,8 +59,9 @@ function Get-DscResourceSchemaPropertyContent 'Read' ) - foreach ($key in $sortOrder) { - $orderedProperties += $Property.GetEnumerator() | Where-Object {$_.State -eq $key} | Sort-Object {$_.Name} + foreach ($key in $sortOrder) + { + $orderedProperties += $Property.GetEnumerator() | Where-Object { $_.State -eq $key } | Sort-Object { $_.Name } } foreach ($currentProperty in $orderedProperties)