You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
does the ScriptPath property point to file path or name?
Yes, this property is filled :
FunctionNewDiagnosticRecord{
param ($Message,$Severity,$Ast)
$Extent=$Ast.Extent$Correction=[Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.CorrectionExtent]::new(
#Informations d’emplacement$Extent.StartLineNumber,$Extent.EndLineNumber,$Extent.StartColumnNumber,$Extent.EndColumnNumber,#Texte de la correction lié à la régle"Texte de la correction lié à la régle",#Nom du fichier concerné$Extent.File,#Description de la correction'Description de la correction'
)
[Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord]::new(
$Message,$Extent,$PSCmdlet.MyInvocation.InvocationName,$Severity,$Extent.File,$null,$Correction
)
}
When i use the fonction outside PSscriptAnalyzer, this property is correctly assigned, but when PSscriptAnalyzer use my function this property is no more correctly assigned :
When I run a custom rule :
The ScriptName and ScriptPath properties are identical :
The text was updated successfully, but these errors were encountered: