This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ConvertFrom-EventLogRecord | |
{ | |
param( | |
[Parameter(Mandatory=$true,ValueFromPipeline=$true)] | |
[System.Diagnostics.Eventing.Reader.EventLogRecord[]] | |
$InputEvent, | |
[Parameter(Mandatory=$true,Position=1)] | |
[ValidateNotNullOrEmpty()] | |
[string[]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PowerShell can infer generic <T> for method calls for your, when it has a parameter of the same type <T> | |
# Example: Enumerable.Distinct<TSource>(IEnumerable<TSource>) | |
# TSource can be inferred from the argument | |
[System.Linq.Enumerable]::Distinct([int[]]@(1,2,3,1,2)) | |
# Let's say you want to call a generic method without ability to infer types. | |
# Example: Enumerable.OfType<TResult>() | |
# Idially you may expect syntax like this | |
# [System.Linq.Enumerable].OfType[int](@(,@(1,2,'a')) | |
# where you tell PowerShell type explicitly. |