public/eidsca/@templateps1.txt
<#
.SYNOPSIS Checks if %ControlName% - %DisplayName% is set to %RecommendedValue% .DESCRIPTION %ControlItemDescription% Queries %RelativeUri% and returns the result of graph/%RelativeUri%.%CurrentValue% -%PwshCompareOperator% %RecommendedValue% .EXAMPLE %PSFunctionName% Returns the result of graph.microsoft.com/beta/%RelativeUri%.%CurrentValue% -%PwshCompareOperator% %RecommendedValue% #> Function %PSFunctionName% { [CmdletBinding()] [OutputType([bool])] param() $result = Invoke-MtGraphRequest -RelativeUri "%RelativeUri%" -ApiVersion %ApiVersion% [string]$tenantValue = $result.%CurrentValue% $testResult = $tenantValue -%PwshCompareOperator% %RecommendedValue% if($testResult){ $testResultMarkdown = "Well done. The configuration in your tenant and recommended value %CompareOperatorText% **%RecommendedValue%** for **%RelativeUri%**" } else { $testResultMarkdown = "Your tenant is configured as **$($tenantValue)**.`n`nThe recommended value %CompareOperatorText% **%RecommendedValue%** for **%RelativeUri%**" } Add-MtTestResultDetail -Result $testResultMarkdown return $tenantValue } |