File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
PSModuleDevelopment/functions/utility Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 38
38
. LINK
39
39
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_language_modes?view=powershell-7.1#constrained-language-constrained-language
40
40
#>
41
+ [Diagnostics.CodeAnalysis.SuppressMessageAttribute (' PSReviewUnusedParameter' , ' ' )]
41
42
[CmdletBinding ()]
42
43
param (
43
44
[Parameter (Mandatory = $true , ValueFromPipeline = $true , ValueFromPipelineByPropertyName = $true )]
103
104
function Search-Ast {
104
105
[CmdletBinding ()]
105
106
param (
106
- [System.Management.Automation.Language.Ast ]
107
+ [System.Management.Automation.Language.Ast ]
107
108
$Ast ,
108
109
109
110
[ScriptBlock ]
283
284
foreach ($file in ($Path | Resolve-Path ).Path) {
284
285
try { $ast = [System.Management.Automation.Language.Parser ]::ParseFile($file , [ref ]$null , [ref ]$null ) }
285
286
catch {
286
- Write-Warning " Error parsing: $file | $_ "
287
- Write-Error $_
287
+ Write-PSFMessage - Level Warning - Message " Error parsing: $file " - ErrorRecord $_ - PSCmdlet $PSCmdlet - EnableException $true
288
288
continue
289
289
}
290
290
You can’t perform that action at this time.
0 commit comments