File tree Expand file tree Collapse file tree 4 files changed +12
-8
lines changed Expand file tree Collapse file tree 4 files changed +12
-8
lines changed Original file line number Diff line number Diff line change 2
2
# Script module for module 'PSScriptAnalyzer'
3
3
#
4
4
5
- function Test-PSEditionCoreCLR
6
- {
7
- ($PSVersionTable.Keys -contains " PSEdition" ) -and ($PSVersionTable.PSEdition -ne ' Desktop' )
8
- }
9
-
10
5
# Clear PSDefaultParameterValues in the module scope and enable strict mode
11
6
$PSDefaultParameterValues.Clear ()
12
7
Set-StrictMode - Version Latest
@@ -19,7 +14,7 @@ $PSModuleRoot = $PSModule.ModuleBase
19
14
$binaryModuleRoot = $PSModuleRoot
20
15
21
16
22
- if ((Test-PSEditionCoreCLR )) {
17
+ if (($PSVersionTable .Keys -contains " PSEdition " ) -and ( $PSVersionTable .PSEdition -ne ' Desktop ' )) {
23
18
$binaryModuleRoot = Join-Path - Path $PSModuleRoot - ChildPath ' coreclr'
24
19
}
25
20
else
Original file line number Diff line number Diff line change 1
- Import-Module - Verbose PSScriptAnalyzer
1
+ $directory = Split-Path - Parent $MyInvocation.MyCommand.Path
2
+ Import-Module - Verbose PSScriptAnalyzer
3
+ $testRootDirectory = Split-Path - Parent $directory
4
+ Import-Module (Join-Path $testRootDirectory ' PSScriptAnalyzerTestHelper.psm1' )
2
5
$sa = Get-Command Get-ScriptAnalyzerRule
3
- $directory = Split-Path - Parent $MyInvocation .MyCommand.Path
6
+
4
7
$singularNouns = " PSUseSingularNouns" # this rule does not exist for coreclr version
5
8
$approvedVerbs = " PSUseApprovedVerbs"
6
9
$cmdletAliases = " PSAvoidUsingCmdletAliases"
Original file line number Diff line number Diff line change 4
4
if (! (Get-Module PSScriptAnalyzer) -and ! $testingLibraryUsage )
5
5
{
6
6
Import-Module PSScriptAnalyzer
7
+ $directory = Split-Path - Parent $MyInvocation.MyCommand.Path
8
+ $testRootDirectory = Split-Path - Parent $directory
9
+ Import-Module (Join-Path $testRootDirectory ' PSScriptAnalyzerTestHelper.psm1' )
7
10
}
8
11
9
12
$sa = Get-Command Invoke-ScriptAnalyzer
Original file line number Diff line number Diff line change
1
+ $directory = Split-Path - Parent $MyInvocation.MyCommand.Path
2
+ $testRootDirectory = Split-Path - Parent $directory
3
+ Import-Module (Join-Path $testRootDirectory ' PSScriptAnalyzerTestHelper.psm1' )
1
4
Import-Module PSScriptAnalyzer
2
5
3
6
# test is meant to verify functionality if chsarp apis are used. Hence not if psedition is CoreCLR
You can’t perform that action at this time.
0 commit comments