Skip to content

Commit 77c780e

Browse files
committed
fix comment from review
1 parent cd929c5 commit 77c780e

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

Modules/ComputerManagementDsc/DSCResources/MSFT_PowerShellExecutionPolicy/MSFT_PowerShellExecutionPolicy.psm1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function Set-TargetResource
9191
}
9292
catch
9393
{
94-
if($_.FullyQualifiedErrorId -eq 'ExecutionPolicyOverride,Microsoft.PowerShell.Commands.SetExecutionPolicyCommand')
94+
if ($_.FullyQualifiedErrorId -eq 'ExecutionPolicyOverride,Microsoft.PowerShell.Commands.SetExecutionPolicyCommand')
9595
{
9696
Write-Verbose -Message ($localizedData.UpdatePowershellExecutionPolicySuccess -f $ExecutionPolicyScope, $ExecutionPolicy)
9797
}
@@ -131,7 +131,7 @@ function Test-TargetResource
131131
$ExecutionPolicy
132132
)
133133

134-
Write-Verbose -Message $localizedData.TestingPowerShellExecutionPolicy
134+
Write-Verbose -Message ($localizedData.TestingPowerShellExecutionPolicy -f $ExecutionPolicyScope, $ExecutionPolicy)
135135

136136
if ((Get-ExecutionPolicy -Scope $ExecutionPolicyScope) -eq $ExecutionPolicy)
137137
{

Modules/ComputerManagementDsc/DSCResources/MSFT_PowerShellExecutionPolicy/en-US/MSFT_PowerShellExecutionPolicy.strings.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# culture="en-US"
22
ConvertFrom-StringData -StringData @'
33
GettingPowerShellExecutionPolicy = The current execution policy for '{0}' is '{1}'.
4-
SettingPowerShellExecutionPolicy = Setting the execution policy '{0}' is '{1}'.
4+
SettingPowerShellExecutionPolicy = Setting the execution policy for '{0}' to '{1}'.
55
PowerShellExecutionPolicyAlreadySetMessage = Powershell execution policy already set to {0}.
66
UpdatePowershellExecutionPolicySuccess = Updating PowerShell Execution policy for '{0}' to '{1}' successfully.
77
UpdatePowershellExecutionPolicyFailed = Updating PowerShell Execution policy for '{0}' to '{1}' failed.

Tests/Unit/MSFT_PowerShellExecutionpolicy.Tests.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#region HEADER
2-
$script:DSCModuleName = 'ComputerManagementDsc'
3-
$script:DSCResourceName = 'MSFT_PowershellExecutionPolicy'
2+
$script:DSCModuleName = 'ComputerManagementDsc'
3+
$script:DSCResourceName = 'MSFT_PowershellExecutionPolicy'
44

55
Import-Module -Name (Join-Path -Path (Join-Path -Path (Split-Path $PSScriptRoot -Parent) -ChildPath 'TestHelpers') -ChildPath 'CommonTestHelper.psm1') -Global
66

77
# Unit Test Template Version: 1.2.0
88
$script:moduleRoot = Join-Path -Path $(Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path))) -ChildPath 'Modules\ComputerManagementDsc'
99
if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests'))) -or `
10-
(-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1'))) )
10+
(-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1'))) )
1111
{
12-
& git @('clone','https://github.com/PowerShell/DscResource.Tests.git',(Join-Path -Path $script:moduleRoot -ChildPath '\DSCResource.Tests\'))
12+
& git @('clone', 'https://github.com/PowerShell/DscResource.Tests.git', (Join-Path -Path $script:moduleRoot -ChildPath '\DSCResource.Tests\'))
1313
}
1414

1515
Import-Module -Name (Join-Path -Path $script:moduleRoot -ChildPath (Join-Path -Path 'DSCResource.Tests' -ChildPath 'TestHelper.psm1')) -Force
@@ -83,7 +83,7 @@ try
8383

8484
It 'Returns false when current policy does not match desired policy' {
8585
Mock -CommandName Get-ExecutionPolicy -MockWith { 'Restricted' }
86-
Test-TargetResource -ExecutionPolicy "Bypass" -ExecutionPolicyScope 'LocalMachine' | Should be $false
86+
Test-TargetResource -ExecutionPolicy 'Bypass' -ExecutionPolicyScope 'LocalMachine' | Should be $false
8787
}
8888

8989
It 'Throws when passed an invalid execution policy Scope' {
@@ -118,7 +118,7 @@ try
118118
$result | should be $null
119119
}
120120

121-
It 'Throws non-caught exceptions'{
121+
It 'Throws non-caught exceptions' {
122122
Mock -CommandName Set-ExecutionPolicy -MockWith { Throw 'Throw me!' }
123123
{ Set-TargetResource -ExecutionPolicy 'Bypass' -ExecutionPolicyScope 'LocalMachine' } | Should -Throw 'Throw me!'
124124
}

0 commit comments

Comments
 (0)