Skip to content

Commit fb7c7b0

Browse files
JamesWTruherTravisEz13
authored andcommitted
Only run tests on Windows, otherwise skip them. (PowerShell#4861)
1 parent de70969 commit fb7c7b0

File tree

2 files changed

+9
-14
lines changed

2 files changed

+9
-14
lines changed

test/powershell/engine/ResourceValidation/CimCmdletsResources.Tests.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ $assemblyName = "Microsoft.Management.Infrastructure.CimCmdlets"
66
# entries in the csproj for the assembly
77
$excludeList = @()
88
# load the module since it isn't there by default
9-
import-module CimCmdlets
9+
if ( $IsWindows )
10+
{
11+
import-module CimCmdlets
12+
}
1013

1114
# run the tests
1215
Test-ResourceStrings -AssemblyName $AssemblyName -ExcludeList $excludeList

test/powershell/engine/ResourceValidation/WSManResources.Tests.ps1

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,9 @@ $assemblyName = "Microsoft.WSMan.Management"
66
# entries in the csproj for the assembly
77
$excludeList = @()
88
# load the module since it isn't there by default
9-
import-module Microsoft.WSMan.Management
10-
11-
12-
try {
13-
if ( ! $IsWindows )
14-
{
15-
$PSDefaultParameterValues["it:skip"] = $true
16-
}
17-
# run the tests
18-
Test-ResourceStrings -AssemblyName $AssemblyName -ExcludeList $excludeList
19-
}
20-
finally {
21-
$PSDefaultParameterValues.Remove("it:skip")
9+
if ( $IsWindows ) {
10+
import-module Microsoft.WSMan.Management
2211
}
12+
13+
# run the tests
14+
Test-ResourceStrings -AssemblyName $AssemblyName -ExcludeList $excludeList

0 commit comments

Comments
 (0)