File tree Expand file tree Collapse file tree
PSModuleDevelopment/functions/utility Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 )]
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 ]
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
You can’t perform that action at this time.
0 commit comments