File tree Expand file tree Collapse file tree 2 files changed +0
-28
lines changed
src/tests/Module/PSModule
tests/outputTestRepo/outputs/module/PSModuleTest Expand file tree Collapse file tree 2 files changed +0
-28
lines changed Original file line number Diff line number Diff line change @@ -89,20 +89,6 @@ Describe 'PSModule - Module tests' {
8989 }
9090 }
9191
92- Context ' Framework - IsWindows compatibility shim' {
93- BeforeAll {
94- Import-Module - Name $moduleManifestPath - Force
95- $script :moduleRef = Get-Module - Name $moduleName
96- }
97- It ' Should have $IsWindows defined in the module scope' {
98- # The framework injects "$IsWindows = $true" for PowerShell 5.1 (Desktop edition).
99- # On PS 7+ (Core), $IsWindows is a built-in automatic variable.
100- # The variable is set inside the module scope and is not exported, so we must check from within the module.
101- $isWindowsDefined = & $script :moduleRef { Get-Variable - Name ' IsWindows' - ErrorAction SilentlyContinue }
102- $isWindowsDefined | Should -Not - BeNullOrEmpty - Because ' the framework injects a compatibility shim for PS 5.1'
103- }
104- }
105-
10692 Context ' Framework - Type accelerator registration' - Skip:(-not $hasClassExporter ) {
10793 BeforeAll {
10894 Import-Module - Name $moduleManifestPath - Force
Original file line number Diff line number Diff line change 11[Diagnostics.CodeAnalysis.SuppressMessageAttribute (' PSAvoidLongLines' , ' ' , Justification = ' Contains long links.' )]
2- [Diagnostics.CodeAnalysis.SuppressMessageAttribute (
3- ' PSAvoidAssignmentToAutomaticVariable' , ' IsWindows' ,
4- Justification = ' IsWindows does not exist in PS5.1'
5- )]
6- [Diagnostics.CodeAnalysis.SuppressMessageAttribute (
7- ' PSUseDeclaredVarsMoreThanAssignments' , ' IsWindows' ,
8- Justification = ' IsWindows does not exist in PS5.1'
9- )]
102[CmdletBinding ()]
113param ()
124
135$scriptName = $MyInvocation.MyCommand.Name
146Write-Debug " [$scriptName ] Importing module"
157
16- # region - IsWindows compatibility shim
17- if ($PSEdition -eq ' Desktop' ) {
18- $IsWindows = $true
19- }
20- # endregion - IsWindows compatibility shim
21-
228# region - Data import
239Write-Debug " [$scriptName ] - [data] - Processing folder"
2410$dataFolder = (Join-Path $PSScriptRoot ' data' )
You can’t perform that action at this time.
0 commit comments