File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22# Script module for module 'PSScriptAnalyzer'
33#
44
5- function Test-PSEditionCoreCLR
6- {
7- ($PSVersionTable.Keys -contains " PSEdition" ) -and ($PSVersionTable.PSEdition -ne ' Desktop' )
8- }
9-
105# Clear PSDefaultParameterValues in the module scope and enable strict mode
116$PSDefaultParameterValues.Clear ()
127Set-StrictMode - Version Latest
@@ -19,7 +14,7 @@ $PSModuleRoot = $PSModule.ModuleBase
1914$binaryModuleRoot = $PSModuleRoot
2015
2116
22- if ((Test-PSEditionCoreCLR )) {
17+ if (($PSVersionTable .Keys -contains " PSEdition " ) -and ( $PSVersionTable .PSEdition -ne ' Desktop ' )) {
2318 $binaryModuleRoot = Join-Path - Path $PSModuleRoot - ChildPath ' coreclr'
2419}
2520else
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' )
25$sa = Get-Command Get-ScriptAnalyzerRule
3- $directory = Split-Path - Parent $MyInvocation .MyCommand.Path
6+
47$singularNouns = " PSUseSingularNouns" # this rule does not exist for coreclr version
58$approvedVerbs = " PSUseApprovedVerbs"
69$cmdletAliases = " PSAvoidUsingCmdletAliases"
Original file line number Diff line number Diff line change 44if (! (Get-Module PSScriptAnalyzer) -and ! $testingLibraryUsage )
55{
66 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' )
710}
811
912$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' )
14Import-Module PSScriptAnalyzer
25
36# 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