en-US/RunspacePoolManager.psm1-Help.xml
<?xml version="1.0" encoding="utf-8"?>
<helpItems xmlns="http://msh" schema="maml"> <!--Edited with: SAPIEN PowerShell HelpWriter 2020 v2.3.47--> <!--Generated by: SAPIEN PowerShell HelpWriter 2020 v2.3.47--> <!-- Module: RunspacePoolManager Version: 1.1.1.1 --> <!--All Commands--> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10"> <!--TAG: HASCOMMONPARAMETERS--> <!--Command--> <command:details> <command:name>Get-HashTableKey</command:name> <maml:description> <maml:para>Returns the value of a key from a hash table.</maml:para> </maml:description> <maml:copyright> <maml:para></maml:para> </maml:copyright> <command:verb>Get</command:verb> <command:noun>HashTableKey</command:noun> <dev:version /> </command:details> <maml:description> <maml:para>Returns the value of a key from a hash table.</maml:para> </maml:description> <command:syntax> <!--Parameter Sets--> <command:syntaxItem parametersetname="__AllParameterSets"> <!--NAME: __AllParameterSets--> <maml:name>Get-HashTableKey</maml:name> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="0"> <maml:name>HashTable</maml:name> <maml:description> <maml:para>The HashTable to search.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue> <dev:type> <maml:name>Hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="1"> <maml:name>Key</maml:name> <maml:description> <maml:para>The key to search for.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <!--All Parameters--> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="False" position="0"> <maml:name>HashTable</maml:name> <maml:description> <maml:para>The HashTable to search.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue> <dev:type> <maml:name>Hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="False" position="1"> <maml:name>Key</maml:name> <maml:description> <maml:para>The key to search for.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> </command:parameters> <command:examples> <!--Examples--> <command:example> <maml:title>EXAMPLE 1</maml:title> <maml:introduction> <maml:para /> </maml:introduction> <dev:code>C:\PS> Get-HashTableKey -HashTable $HashTable -Key 'test'</dev:code> <dev:remarks> <maml:para>This would return the value of the key 'test' in the hash table.</maml:para> </dev:remarks> </command:example> </command:examples> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10"> <!--TAG: HASCOMMONPARAMETERS--> <!--Command--> <command:details> <command:name>New-HashTableKey</command:name> <maml:description> <maml:para>Creates a new key in the hash table and sets its value.</maml:para> </maml:description> <maml:copyright> <maml:para></maml:para> </maml:copyright> <command:verb>New</command:verb> <command:noun>HashTableKey</command:noun> <dev:version /> </command:details> <maml:description> <maml:para>Creates a new key in the hash table and sets its value.</maml:para> </maml:description> <command:syntax> <!--Parameter Sets--> <command:syntaxItem parametersetname="__AllParameterSets"> <!--NAME: __AllParameterSets--> <maml:name>New-HashTableKey</maml:name> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="0"> <maml:name>HashTable</maml:name> <maml:description> <maml:para>The HashTable to add too.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue> <dev:type> <maml:name>Hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="1"> <maml:name>Key</maml:name> <maml:description> <maml:para>The key to add.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="2"> <maml:name>Value</maml:name> <maml:description> <maml:para>The value to assign to the key.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Object</command:parameterValue> <dev:type> <maml:name>Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Force</maml:name> <maml:description> <maml:para>Will automatically run Set-HashKeyTable if that would be the right command.</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <!--All Parameters--> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="False" position="0"> <maml:name>HashTable</maml:name> <maml:description> <maml:para>The HashTable to add too.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue> <dev:type> <maml:name>Hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="False" position="1"> <maml:name>Key</maml:name> <maml:description> <maml:para>The key to add.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="False" position="2"> <maml:name>Value</maml:name> <maml:description> <maml:para>The value to assign to the key.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Object</command:parameterValue> <dev:type> <maml:name>Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="False" position="named"> <maml:name>Force</maml:name> <maml:description> <maml:para>Will automatically run Set-HashKeyTable if that would be the right command.</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:examples> <!--Examples--> <command:example> <maml:title>EXAMPLE 1</maml:title> <maml:introduction> <maml:para /> </maml:introduction> <dev:code>C:\PS> New-HashTableKey -HashTable $HashTable -Key 'test' -Value 'test string'</dev:code> <dev:remarks> <maml:para>This would add a key to the HashTable called 'test' with a value of 'test string'.</maml:para> </dev:remarks> </command:example> </command:examples> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10"> <!--TAG: HASCOMMONPARAMETERS--> <!--Command--> <command:details> <command:name>New-SynchronizedHashTable</command:name> <maml:description> <maml:para>Creates an empty synchronized hash table.</maml:para> </maml:description> <maml:copyright> <maml:para></maml:para> </maml:copyright> <command:verb>New</command:verb> <command:noun>SynchronizedHashTable</command:noun> <dev:version /> </command:details> <maml:description> <maml:para>Creates an empty synchronized hash table.</maml:para> </maml:description> <command:syntax> <!--Parameter Sets--> <command:syntaxItem parametersetname="__AllParameterSets"> <!--NAME: __AllParameterSets--> <maml:name>New-SynchronizedHashTable</maml:name> </command:syntaxItem> </command:syntax> <command:parameters> <!--All Parameters--> </command:parameters> <command:returnValues> <!--Outputs--> <command:returnValue> <dev:type> <maml:name>System.Collections.Hashtable</maml:name> <maml:uri></maml:uri> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <command:examples> <!--Examples--> <command:example> <maml:title>EXAMPLE 1</maml:title> <maml:introduction> <maml:para /> </maml:introduction> <dev:code>C:\PS> $HashTable = New-SynchronizedHashTable</dev:code> <dev:remarks> <maml:para>This would create a synchronized hash table inside $HashTable.</maml:para> </dev:remarks> </command:example> </command:examples> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10"> <!--TAG: HASCOMMONPARAMETERS--> <!--Command--> <command:details> <command:name>Remove-HashTableKey</command:name> <maml:description> <maml:para>Removes a key from a hash table.</maml:para> </maml:description> <maml:copyright> <maml:para></maml:para> </maml:copyright> <command:verb>Remove</command:verb> <command:noun>HashTableKey</command:noun> <dev:version /> </command:details> <maml:description> <maml:para>Removes a key from a hash table.</maml:para> </maml:description> <command:syntax> <!--Parameter Sets--> <command:syntaxItem parametersetname="__AllParameterSets"> <!--NAME: __AllParameterSets--> <maml:name>Remove-HashTableKey</maml:name> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="0"> <maml:name>HashTable</maml:name> <maml:description> <maml:para>The HashTable to remove from.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue> <dev:type> <maml:name>Hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="1"> <maml:name>Key</maml:name> <maml:description> <maml:para>The key to remove.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Force</maml:name> <maml:description> <maml:para>Use this to suppress the warning if the key does not exist.</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <!--All Parameters--> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="False" position="0"> <maml:name>HashTable</maml:name> <maml:description> <maml:para>The HashTable to remove from.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue> <dev:type> <maml:name>Hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="False" position="1"> <maml:name>Key</maml:name> <maml:description> <maml:para>The key to remove.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="False" position="named"> <maml:name>Force</maml:name> <maml:description> <maml:para>Use this to suppress the warning if the key does not exist.</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:examples> <!--Examples--> <command:example> <maml:title>EXAMPLE 1</maml:title> <maml:introduction> <maml:para /> </maml:introduction> <dev:code>C:\PS> Remove-HashTableKey -HashTable $HashTable -Key 'test'</dev:code> <dev:remarks> <maml:para>This would remove the key 'test' and its value from the hash table.</maml:para> </dev:remarks> </command:example> </command:examples> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10"> <!--TAG: HASCOMMONPARAMETERS--> <!--Command--> <command:details> <command:name>Set-HashTableKey</command:name> <maml:description> <maml:para>Sets the value of a key in the hash table.</maml:para> </maml:description> <maml:copyright> <maml:para></maml:para> </maml:copyright> <command:verb>Set</command:verb> <command:noun>HashTableKey</command:noun> <dev:version /> </command:details> <maml:description> <maml:para>Sets the value of a key in the hash table.</maml:para> </maml:description> <command:syntax> <!--Parameter Sets--> <command:syntaxItem parametersetname="__AllParameterSets"> <!--NAME: __AllParameterSets--> <maml:name>Set-HashTableKey</maml:name> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="0"> <maml:name>HashTable</maml:name> <maml:description> <maml:para>The HashTable to set.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue> <dev:type> <maml:name>Hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="1"> <maml:name>Key</maml:name> <maml:description> <maml:para>The key to set.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="2"> <maml:name>Value</maml:name> <maml:description> <maml:para>The value to overwrite.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Object</command:parameterValue> <dev:type> <maml:name>Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Force</maml:name> <maml:description> <maml:para>Will automatically run New-HashKeyTable if that would be the right command.</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <!--All Parameters--> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="False" position="0"> <maml:name>HashTable</maml:name> <maml:description> <maml:para>The HashTable to set.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue> <dev:type> <maml:name>Hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="False" position="1"> <maml:name>Key</maml:name> <maml:description> <maml:para>The key to set.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="False" position="2"> <maml:name>Value</maml:name> <maml:description> <maml:para>The value to overwrite.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Object</command:parameterValue> <dev:type> <maml:name>Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="False" position="named"> <maml:name>Force</maml:name> <maml:description> <maml:para>Will automatically run New-HashKeyTable if that would be the right command.</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:examples> <!--Examples--> <command:example> <maml:title>EXAMPLE 1</maml:title> <maml:introduction> <maml:para /> </maml:introduction> <dev:code>C:\PS> Set-HashTableKey -HashTable $HashTable -Key 'test' -Value 'updated test string'</dev:code> <dev:remarks> <maml:para>This would set the key 'test' in the HashTable too the value 'updated test string'.</maml:para> </dev:remarks> </command:example> </command:examples> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10"> <!--TAG: HASCOMMONPARAMETERS--> <!--Command--> <command:details> <command:name>Start-RunspacePool</command:name> <maml:description> <maml:para>Starts a runspace pool.</maml:para> </maml:description> <maml:copyright> <maml:para></maml:para> </maml:copyright> <command:verb>Start</command:verb> <command:noun>RunspacePool</command:noun> <dev:version /> </command:details> <maml:description> <maml:para>Starts a runspace pool.</maml:para> </maml:description> <command:syntax> <!--Parameter Sets--> <command:syntaxItem parametersetname="__AllParameterSets"> <!--NAME: __AllParameterSets--> <maml:name>Start-RunspacePool</maml:name> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="0"> <maml:name>MaxJobs</maml:name> <maml:description> <maml:para>The maximum number of jobs the runspace pool can do in at once.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> <dev:type> <maml:name>Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$env:NUMBER_OF_PROCESSORS</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="1"> <maml:name>InitialSessionState</maml:name> <maml:description> <maml:para>You can load a custom session state here but how to do that is outside the scope of this project.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">InitialSessionState</command:parameterValue> <dev:type> <maml:name>InitialSessionState</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>[System.Management.Automation.Runspaces.InitialSessionState]::CreateDefault()</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="2"> <maml:name>CleanupInterval</maml:name> <maml:description> <maml:para>How often to cleanup completed jobs from the runspace pool. Must be represented as 'HH:MM:SS'.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">TimeSpan</command:parameterValue> <dev:type> <maml:name>TimeSpan</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>00:15:00</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <!--All Parameters--> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="0"> <maml:name>MaxJobs</maml:name> <maml:description> <maml:para>The maximum number of jobs the runspace pool can do in at once.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Int32</command:parameterValue> <dev:type> <maml:name>Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$env:NUMBER_OF_PROCESSORS</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="1"> <maml:name>InitialSessionState</maml:name> <maml:description> <maml:para>You can load a custom session state here but how to do that is outside the scope of this project.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">InitialSessionState</command:parameterValue> <dev:type> <maml:name>InitialSessionState</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>[System.Management.Automation.Runspaces.InitialSessionState]::CreateDefault()</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="2"> <maml:name>CleanupInterval</maml:name> <maml:description> <maml:para>How often to cleanup completed jobs from the runspace pool. Must be represented as 'HH:MM:SS'.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">TimeSpan</command:parameterValue> <dev:type> <maml:name>TimeSpan</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>00:15:00</dev:defaultValue> </command:parameter> </command:parameters> <command:returnValues> <!--Outputs--> <command:returnValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.RunspacePool</maml:name> <maml:uri></maml:uri> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <command:examples> <!--Examples--> <command:example> <maml:title>EXAMPLE 1</maml:title> <maml:introduction> <maml:para /> </maml:introduction> <dev:code>C:\PS> $runspacePool = Start-RunspacePool</dev:code> <dev:remarks> <maml:para>This would create a runspace pool with default values in the object 'runspacePool'.</maml:para> </dev:remarks> </command:example> </command:examples> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10"> <!--TAG: HASCOMMONPARAMETERS--> <!--Command--> <command:details> <command:name>Start-RunspacePoolJob</command:name> <maml:description> <maml:para>Queues a job into a runspace pool.</maml:para> </maml:description> <maml:copyright> <maml:para></maml:para> </maml:copyright> <command:verb>Start</command:verb> <command:noun>RunspacePoolJob</command:noun> <dev:version /> </command:details> <maml:description> <maml:para>Queues a job into a runspace pool. Uses Using variables or a synchronized hash table.</maml:para> </maml:description> <command:syntax> <!--Parameter Sets--> <command:syntaxItem parametersetname="__AllParameterSets"> <!--NAME: __AllParameterSets--> <maml:name>Start-RunspacePoolJob</maml:name> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="0"> <maml:name>ScriptBlock</maml:name> <maml:description> <maml:para>The script block to run.</maml:para> <maml:para>This can reference variables by using $using:var or by using the HashTable param and using $HashTable in this script block.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ScriptBlock</command:parameterValue> <dev:type> <maml:name>ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="0"> <maml:name>HashTable</maml:name> <maml:description> <maml:para>A synchronized hash table to load into the job.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue> <dev:type> <maml:name>Hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="1"> <maml:name>RunspacePool</maml:name> <maml:description> <maml:para>The runspace pool to submit the job too.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">RunspacePool</command:parameterValue> <dev:type> <maml:name>RunspacePool</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <!--All Parameters--> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="False" position="0"> <maml:name>ScriptBlock</maml:name> <maml:description> <maml:para>The script block to run.</maml:para> <maml:para>This can reference variables by using $using:var or by using the HashTable param and using $HashTable in this script block.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ScriptBlock</command:parameterValue> <dev:type> <maml:name>ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="False" position="1"> <maml:name>RunspacePool</maml:name> <maml:description> <maml:para>The runspace pool to submit the job too.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">RunspacePool</command:parameterValue> <dev:type> <maml:name>RunspacePool</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="False" position="0"> <maml:name>HashTable</maml:name> <maml:description> <maml:para>A synchronized hash table to load into the job.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Hashtable</command:parameterValue> <dev:type> <maml:name>Hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> </command:parameters> <command:examples> <!--Examples--> <command:example> <maml:title>EXAMPLE 1</maml:title> <maml:introduction> <maml:para /> </maml:introduction> <dev:code>C:\PS> $runspacePool = Start-RunspacePool C:\PS> Start-RunspacePoolJob -RunspacePool $runspacePool -ScriptBlock { New-File -Path C:\test.txt -Force }</dev:code> <dev:remarks> <maml:para>This would submit a job to the runspace pool that would create the file C:\test.txt.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>EXAMPLE 2</maml:title> <maml:introduction> <maml:para /> </maml:introduction> <dev:code>C:\PS> $runspacePool = Start-RunspacePool C:\PS> $i = 365 C:\PS> Start-RunspacePoolJob -RunspacePool $runspacePool -ScriptBlock { New-File -Path C:\test$($using:i).txt -Force }</dev:code> <dev:remarks> <maml:para>This would submit a job to the runspace pool that would create the file C:\test365.txt.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>EXAMPLE 3</maml:title> <maml:introduction> <maml:para /> </maml:introduction> <dev:code>C:\PS> $runspacePool = Start-RunspacePool C:\PS> $myHashTable = New-SynchronizedHashTable C:\PS> [int]$counter = 0 C:\PS> New-HashTableKey -HashTable $myHashTable -Key 'counter' -Value $counter C:\PS> for ($i=1; $i -lt 20000; $i++) { $jobs = Start-RunspacePoolJob -RunspacePool $runspacePool -HashTable $myHashTable -ScriptBlock { $HashTable['counter']++ Start-Sleep -Seconds 1 } }</dev:code> <dev:remarks> <maml:para>This would queue 20,000 jobs that would each increment the value of the 'counter' string in 'myHashTable' and wait for 1 second. You can run $myHashTable['counter'] at the console to watch the number increment after all the jobs are queued.</maml:para> <maml:para>Note that while my object is called 'myHashTable' it is always referenced as 'HashTable' in the script block.</maml:para> </dev:remarks> </command:example> </command:examples> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10"> <!--TAG: HASCOMMONPARAMETERS--> <!--Command--> <command:details> <command:name>Stop-RunspacePool</command:name> <maml:description> <maml:para>Stops a runspace pool.</maml:para> </maml:description> <maml:copyright> <maml:para></maml:para> </maml:copyright> <command:verb>Stop</command:verb> <command:noun>RunspacePool</command:noun> <dev:version /> </command:details> <maml:description> <maml:para>Stops a runspace pool.</maml:para> </maml:description> <command:syntax> <!--Parameter Sets--> <command:syntaxItem parametersetname="__AllParameterSets"> <!--NAME: __AllParameterSets--> <maml:name>Stop-RunspacePool</maml:name> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="0"> <maml:name>RunspacePool</maml:name> <maml:description> <maml:para>The runspace pool object to stop.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">RunspacePool</command:parameterValue> <dev:type> <maml:name>RunspacePool</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <!--All Parameters--> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="False" position="0"> <maml:name>RunspacePool</maml:name> <maml:description> <maml:para>The runspace pool object to stop.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">RunspacePool</command:parameterValue> <dev:type> <maml:name>RunspacePool</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> </command:parameters> <command:examples> <!--Examples--> <command:example> <maml:title>EXAMPLE 1</maml:title> <maml:introduction> <maml:para /> </maml:introduction> <dev:code>C:\PS> Stop-RunspacePool -RunspacePool $runspacePool</dev:code> <dev:remarks> <maml:para>This would stop the runspace pool in the object 'runspacePool', aborting all running jobs, and canceling all pending jobs.</maml:para> </dev:remarks> </command:example> </command:examples> </command:command> <!--Generated by: SAPIEN PowerShell HelpWriter 2020 v2.3.47--> </helpItems> |