Operating system: Windows 11
PowerShell version(s): 5.8.249
There is an incorrect warning on filter functions using pipeline values.
Per https://learn.microsoft.com/en-us/power ... escription:
PowerShell version(s): 5.8.249
There is an incorrect warning on filter functions using pipeline values.
Code:
filter Get-AbsoluteFilePath {
[OutputType([string])]
param
(
[Parameter(Mandatory = $true,
ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true)]
[ValidateNotNullOrEmpty()]
[Alias('FullName')]
[string]$FileName
)
return "$($ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($FileName))"
}
Per https://learn.microsoft.com/en-us/power ... escription:
The filter keyword is used to create a type of function that runs on each object in the pipeline. A filter resembles a function with all its statements in a process block.
Statistics: Posted by Ron Klimaszewski — Thu Oct 24, 2024 7:54 am — Replies 1 — Views 12