Skip to content

Commit af243e6

Browse files
fixing tests
1 parent 3ddb70e commit af243e6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

PSModuleDevelopment/functions/utility/Test-PSMDClmCompatibility.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
.LINK
3939
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_language_modes?view=powershell-7.1#constrained-language-constrained-language
4040
#>
41+
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSReviewUnusedParameter', '')]
4142
[CmdletBinding()]
4243
param (
4344
[Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)]
@@ -103,7 +104,7 @@
103104
function Search-Ast {
104105
[CmdletBinding()]
105106
param (
106-
[System.Management.Automation.Language.Ast]
107+
[System.Management.Automation.Language.Ast]
107108
$Ast,
108109

109110
[ScriptBlock]
@@ -283,8 +284,7 @@
283284
foreach ($file in ($Path | Resolve-Path).Path) {
284285
try { $ast = [System.Management.Automation.Language.Parser]::ParseFile($file, [ref]$null, [ref]$null) }
285286
catch {
286-
Write-Warning "Error parsing: $file | $_"
287-
Write-Error $_
287+
Write-PSFMessage -Level Warning -Message "Error parsing: $file" -ErrorRecord $_ -PSCmdlet $PSCmdlet -EnableException $true
288288
continue
289289
}
290290

0 commit comments

Comments
 (0)