< Back

Set-PSFDynamicContentObject

Sun Jan 19, 2020 6:44 pm

NAME Set-PSFDynamicContentObject



SYNOPSIS

Updates a value object that can easily be accessed on another runspace.





SYNTAX

Set-PSFDynamicContentObject [-Name <String[]>] [-Object <DynamicContentObject[]>] -Value <Object> [-PassThru]

[-Reset] [<CommonParameters>]



Set-PSFDynamicContentObject [-Name <String[]>] [-Object <DynamicContentObject[]>] -Queue [-PassThru] [-Reset]

[<CommonParameters>]



Set-PSFDynamicContentObject [-Name <String[]>] [-Object <DynamicContentObject[]>] -Stack [-PassThru] [-Reset]

[<CommonParameters>]



Set-PSFDynamicContentObject [-Name <String[]>] [-Object <DynamicContentObject[]>] -List [-PassThru] [-Reset]

[<CommonParameters>]



Set-PSFDynamicContentObject [-Name <String[]>] [-Object <DynamicContentObject[]>] -Dictionary [-PassThru] [-Reset]

[<CommonParameters>]





DESCRIPTION

Updates a value object that can easily be accessed on another runspace.



The Dynamic Content Object system allows the user to easily have the content of a variable updated in the

background.

The update is performed by this very function.





PARAMETERS

-Name <String[]>

The name of the value to update.

Not case sensitive.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Object <DynamicContentObject[]>

The value object to update



Required? false

Position? named

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-Value <Object>

The value to apply



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Queue [<SwitchParameter>]

Set the object to be a threadsafe queue.

Safe to use in multiple runspaces in parallel.

Will not apply changes if the current value is already such an object.



Required? true

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Stack [<SwitchParameter>]

Set the object to be a threadsafe stack.

Safe to use in multiple runspaces in parallel.

Will not apply changes if the current value is already such an object.



Required? true

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-List [<SwitchParameter>]

Set the object to be a threadsafe list.

Safe to use in multiple runspaces in parallel.

Will not apply changes if the current value is already such an object.



Required? true

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Dictionary [<SwitchParameter>]

Set the object to be a threadsafe dictionary.

Safe to use in multiple runspaces in parallel.

Will not apply changes if the current value is already such an object.



Required? true

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-PassThru [<SwitchParameter>]

Has the command returning the object just set.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Reset [<SwitchParameter>]

Clears the dynamic content object's collection objects.

Use this to ensure the collection is actually empty.

Only used in combination of either -Queue, -Stack, -List or -Dictionary.



Required? false

Position? named

Default value False

Accept pipeline input? false

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

PSFramework.Utility.DynamicContentObject





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



PS C:\\>Set-PSFDynamicContentObject -Name Test -Value $Value



Sets the Dynamic Content Object named "test" to the value $Value.









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Set-PSFDynamicContentObject -Name MyModule.Value -Queue



Sets the Dynamic Content Object named "MyModule.Value" to contain a threadsafe queue.

This queue will be safe to enqueue and dequeue from, no matter the number of runspaces accessing it simultaneously.











RELATED LINKS