Skip to content

Commit a2edd3e

Browse files
committed
removed redundant string casting
1 parent e2c55c7 commit a2edd3e

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

src/powershell/tests/Test-Assessment.41039.ps1

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,13 @@ function Test-Assessment-41039 {
144144
}
145145
else {
146146
foreach ($rule in ($malwareRules | Where-Object { $_.State -eq 'Enabled' })) {
147-
$policy = $malwarePolicyByIdentity[[string]$rule.MalwareFilterPolicy]
147+
$policy = $malwarePolicyByIdentity[$rule.MalwareFilterPolicy]
148148
if ($null -eq $policy) {
149149
$hasInvestigate = $true
150150
$malwarePolicyRows += [PSCustomObject]@{
151-
PolicyIdentity = [string]$rule.MalwareFilterPolicy
151+
PolicyIdentity = $rule.MalwareFilterPolicy
152152
IsDefault = $false
153-
RuleName = [string]$rule.Name
153+
RuleName = $rule.Name
154154
ZapEnabled = $null
155155
Result = 'Investigate'
156156
StatusDetail = 'referenced policy not found'
@@ -174,7 +174,7 @@ function Test-Assessment-41039 {
174174
$malwarePolicyRows += [PSCustomObject]@{
175175
PolicyIdentity = $policy.Identity
176176
IsDefault = $false
177-
RuleName = [string]$rule.Name
177+
RuleName = $rule.Name
178178
ZapEnabled = if ($propertyKnown) { $propertyEnabled } else { $null }
179179
Result = $result
180180
StatusDetail = if ($propertyKnown) { $null } else { 'ZapEnabled value is unavailable' }
@@ -247,13 +247,13 @@ function Test-Assessment-41039 {
247247
}
248248
else {
249249
foreach ($rule in ($spamRules | Where-Object { $_.State -eq 'Enabled' })) {
250-
$policy = $spamPolicyByIdentity[[string]$rule.HostedContentFilterPolicy]
250+
$policy = $spamPolicyByIdentity[$rule.HostedContentFilterPolicy]
251251
if ($null -eq $policy) {
252252
$hasInvestigate = $true
253253
$spamPolicyRows += [PSCustomObject]@{
254-
PolicyIdentity = [string]$rule.HostedContentFilterPolicy
254+
PolicyIdentity = $rule.HostedContentFilterPolicy
255255
IsDefault = $false
256-
RuleName = [string]$rule.Name
256+
RuleName = $rule.Name
257257
PhishZapEnabled = $null
258258
SpamZapEnabled = $null
259259
Result = 'Investigate'
@@ -280,7 +280,7 @@ function Test-Assessment-41039 {
280280
$spamPolicyRows += [PSCustomObject]@{
281281
PolicyIdentity = $policy.Identity
282282
IsDefault = $false
283-
RuleName = [string]$rule.Name
283+
RuleName = $rule.Name
284284
PhishZapEnabled = if ($phishZapKnown) { $phishZapEnabled } else { $null }
285285
SpamZapEnabled = if ($spamZapKnown) { $spamZapEnabled } else { $null }
286286
Result = $result

0 commit comments

Comments
 (0)