Skip to content

Commit 7406fc0

Browse files
author
Kapil Borle
committed
Fix bugs in RuleMaker.ps1 and New-CommandDataFile.psm1
1 parent 36fe25a commit 7406fc0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Utils/New-CommandDataFile.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ if (-not (Test-Path $builtinModulePath))
3838

3939
Function IsPSEditionDesktop
4040
{
41-
$PSEdition -eq $null -or $PSEdition -eq 'Desktop'
41+
(Get-Variable -Name PSEdition -ErrorAction Ignore) -or ($PSEdition -eq 'Desktop')
4242
}
4343

4444
Function Get-CmdletDataFileName

Utils/RuleMaker.psm1

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Function Get-SolutionRoot
2525
$solutionFilename = 'psscriptanalyzer.sln'
2626
if (-not (Test-Path (Join-Path $root $solutionFilename)))
2727
{
28-
$null
28+
return $null
2929
}
3030
$root
3131
}
@@ -35,7 +35,7 @@ Function Get-RuleProjectRoot
3535
$slnRoot = Get-SolutionRoot
3636
if ($slnRoot -eq $null)
3737
{
38-
$null
38+
return $null
3939
}
4040
Join-Path $slnRoot "Rules"
4141
}
@@ -45,7 +45,7 @@ Function Get-RuleProjectFile
4545
$prjRoot = Get-RuleProjectRoot
4646
if ($prjRoot -eq $null)
4747
{
48-
$null
48+
return $null
4949
}
5050
Join-Path $prjRoot "ScriptAnalyzerBuiltinRules.csproj"
5151
}

0 commit comments

Comments
 (0)