< Back

ConvertTo-IndexedTable

Mon Jan 13, 2020 7:13 am

NAME ConvertTo-IndexedTable



SYNOPSIS

Converts an array of objects to a array of hashtables for performance





SYNTAX

ConvertTo-IndexedTable [-IndexFieldName] <Object> [-Object] <Object> [<CommonParameters>]





DESCRIPTION

Converts an array of objects to a hashtable of hashtables for performance

The hashtable has takes one field as index, for example name

and the index field can be used to filter/sort much quicker than and array of objects.

(see example for details)





PARAMETERS

-IndexFieldName <Object>



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Object <Object>



Required? true

Position? 2

Default value

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Get-CMDevice -CollectionName "All Systems" -Fast | ConvertTo-IndexedTable Name



Name Value

---- -----

Object ...

Name NCOP-CCMP-CCM01



the index field is available directly, while the complete object is available in the object key of the hash table.











RELATED LINKS





CommonParameters : False

WorkflowCommonParameters : False

details : @{name=Get-CTReturnObject; noun=; verb=}

Syntax : @{syntaxItem=System.Object[]}

parameters : @{parameter=System.Object[]}

inputTypes : @{inputType=}

returnValues : @{returnValue=}

aliases : None



remarks : None

alertSet :

description :

examples :

Synopsis :

Get-CTReturnObject [[-Status] <string>] [[-ErrorMessage] <string>] [[-Tracelog]

<ArrayList>] [[-InputParameters] <hashtable>] [[-Output] <ArrayList>]



ModuleName : CTToolkit

nonTerminatingErrors :

xmlns:command : http://schemas.microsoft.com/maml/dev/command/2004/10

xmlns:dev : http://schemas.microsoft.com/maml/dev/2004/10

xmlns:maml : http://schemas.microsoft.com/maml/2004/10

Name : Get-CTReturnObject

Category : Function

Component :

Role :

Functionality :





CommonParameters : False

WorkflowCommonParameters : False

details : @{name=Get-TraceLog; noun=; verb=}

Syntax : @{syntaxItem=System.Object[]}

parameters : @{parameter=System.Object[]}

inputTypes : @{inputType=}

returnValues : @{returnValue=}

aliases : None



remarks : None

alertSet :

description :

examples :

Synopsis :

Get-TraceLog



ModuleName : CTToolkit

nonTerminatingErrors :

xmlns:command : http://schemas.microsoft.com/maml/dev/command/2004/10

xmlns:dev : http://schemas.microsoft.com/maml/dev/2004/10

xmlns:maml : http://schemas.microsoft.com/maml/2004/10

Name : Get-TraceLog

Category : Function

Component :

Role :

Functionality :