Skip to content

New-PodeStateList

SYNOPSIS

Creates a new concurrent list for use in the shared state.

SYNTAX

New-PodeStateList [[-Data] <Object[]>] [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

Creates a new concurrent list for use in the shared state. This is useful for storing a collection of objects in a thread-safe manner while maintaining the order of insertion.

EXAMPLES

EXAMPLE 1

Set-PodeState -Name 'MyList' -Value (New-PodeStateList)

EXAMPLE 2

Set-PodeState -Name 'MyList' -Value (New-PodeStateList -Data @('Item1', 'Item2'))

PARAMETERS

-Data

An optional array of initial objects to populate the list.

Type: Object[]
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.PodeConcurrentList`1[[System.Object, System.Private.CoreLib, Version=10.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]

System.Object[]

NOTES

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