Skip to content

Instantly share code, notes, and snippets.

@IISResetMe
Created November 11, 2020 15:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IISResetMe/11d2e42eb066b005c2866d54a2873e17 to your computer and use it in GitHub Desktop.
Save IISResetMe/11d2e42eb066b005c2866d54a2873e17 to your computer and use it in GitHub Desktop.
function ConvertTo-List
{
param(
[Parameter(Mandatory = $true, ValueFromPipeline = $true)]
[object[]]$InputObject
)
begin {
$list = [System.Collections.Generic.List[object]]::new()
}
process {
$list.AddRange($InputObject)
}
end {
Write-Output $list -NoEnumerate
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment