Skip to content

Commit 4f3ecc6

Browse files
author
Kapil Borle
committed
Set DSC dependency handling only for PSv5 and above
1 parent 8e0bdfa commit 4f3ecc6

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Tests/Engine/InvokeScriptAnalyzer.tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Describe "Test available parameters" {
6969
}
7070
}
7171

72-
if (!$testingLibraryUsage)
72+
if (!$testingLibraryUsage -and ($PSVersionTable.PSVersion -ge [Version]'5.0'))
7373
{
7474
Context "SaveDscDependency parameter" {
7575
It "has the parameter" {

Tests/Engine/ModuleDependencyHandler.tests.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ if ($testingLibraryUsage)
88
return
99
}
1010

11+
# DSC Module saving is not supported in versions less than PSv5
12+
if (($PSVersionTable.PSVersion -lt [Version]'5.0'))
13+
{
14+
return
15+
}
16+
1117
$directory = Split-Path -Parent $MyInvocation.MyCommand.Path
1218
$violationFileName = 'MissingDSCResource.ps1'
1319
$violationFilePath = Join-Path $directory $violationFileName

0 commit comments

Comments
 (0)