Skip to content

New-PodeStateOrderedDictionary

SYNOPSIS

Creates a new concurrent ordered dictionary for use in the shared state.

SYNTAX

New-PodeStateOrderedDictionary [[-Data] <Hashtable>] [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

Creates a new concurrent ordered dictionary for use in the shared state. This is useful for storing key-value pairs in a thread-safe manner while maintaining the order of insertion.

EXAMPLES

EXAMPLE 1

Set-PodeState -Name 'MyOrderedDictionary' -Value (New-PodeStateOrderedDictionary)

EXAMPLE 2

Set-PodeState -Name 'MyOrderedDictionary' -Value (New-PodeStateOrderedDictionary -Data @{ 'Key1' = 'Value1'; 'Key2' = 'Value2' })

PARAMETERS

-Data

An optional hashtable of initial key-value pairs to populate the ordered dictionary.

Type: Hashtable
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

{{ Fill ProgressAction Description }}

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

Pode.Utilities.Structures.PodeConcurrentOrderedDictionary`2[[System.String, System.Private.CoreLib, Version=10.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Object, System.Private.CoreLib, Version=10.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]

System.Object[]

NOTES

This uses a custom concurrent ordered dictionary implementation to ensure thread safety and maintain order of insertion. The PodeConcurrentOrderedDictionary class is defined in the Pode.Utilities.Structures namespace.