Start-CommandMultiThreaded
export const frontMatter = {
'external help file': 'Keldor-help.xml',
'Module Name': 'Keldor',
'online version': 'https://docs.keldor.dev/powershell/keldor/Start-CommandMultiThreaded',
schema: '2.0.0'
};
export const contentTitle = 'Start-CommandMultiThreaded';
export {default as metadata} from '@site/.docusaurus/docusaurus-plugin-content-docs/powershell/site-docs-powershell-keldor-start-command-multi-threaded-md-b43.json'
export const assets = {
};
import {Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs} from "react/jsx-runtime";
import {useMDXComponents as _provideComponents} from "@mdx-js/react";
export const toc = [{
"value": "SYNOPSIS",
"id": "synopsis",
"level": 2
}, {
"value": "SYNTAX",
"id": "syntax",
"level": 2
}, {
"value": "DESCRIPTION",
"id": "description",
"level": 2
}, {
"value": "EXAMPLES",
"id": "examples",
"level": 2
}, {
"value": "EXAMPLE 1",
"id": "example-1",
"level": 3
}, {
"value": "EXAMPLE 2",
"id": "example-2",
"level": 3
}, {
"value": "EXAMPLE 3",
"id": "example-3",
"level": 3
}, {
"value": "EXAMPLE 4",
"id": "example-4",
"level": 3
}, {
"value": "PARAMETERS",
"id": "parameters",
"level": 2
}, {
"value": "-AddParameter",
"id": "-addparameter",
"level": 3
}, {
"value": "-AddSwitch",
"id": "-addswitch",
"level": 3
}, {
"value": "-Command",
"id": "-command",
"level": 3
}, {
"value": "-MaxThreads",
"id": "-maxthreads",
"level": 3
}, {
"value": "-MaxTime",
"id": "-maxtime",
"level": 3
}, {
"value": "-Objects",
"id": "-objects",
"level": 3
}, {
"value": "-SleepTimer",
"id": "-sleeptimer",
"level": 3
}, {
"value": "CommonParameters",
"id": "commonparameters",
"level": 3
}, {
"value": "INPUTS",
"id": "inputs",
"level": 2
}, {
"value": "System.Management.Automation.PSObject.System.String",
"id": "systemmanagementautomationpsobjectsystemstring",
"level": 3
}, {
"value": "OUTPUTS",
"id": "outputs",
"level": 2
}, {
"value": "System.Management.Automation.PSCustomObject",
"id": "systemmanagementautomationpscustomobject",
"level": 3
}, {
"value": "NOTES",
"id": "notes",
"level": 2
}, {
"value": "RELATED LINKS",
"id": "related-links",
"level": 2
}];
function _createMdxContent(props) {
const _components = {
a: "a",
code: "code",
h1: "h1",
h2: "h2",
h3: "h3",
header: "header",
p: "p",
pre: "pre",
..._provideComponents(),
...props.components
};
return _jsxs(_Fragment, {
children: [_jsx(_components.header, {
children: _jsx(_components.h1, {
id: "start-commandmultithreaded",
children: "Start-CommandMultiThreaded"
})
}), "\n", _jsx(_components.h2, {
id: "synopsis",
children: "SYNOPSIS"
}), "\n", _jsx(_components.p, {
children: "Takes a single command and multithreads it."
}), "\n", _jsx(_components.h2, {
id: "syntax",
children: "SYNTAX"
}), "\n", _jsx(_components.pre, {
children: _jsx(_components.code, {
className: "language-powershell",
children: "Start-CommandMultiThreaded [[-Command] ] [[-Objects] <String[]>] [[-MaxThreads] ]\n [[-MaxTime] ] [[-SleepTimer] ] [[-AddParameter] ] [[-AddSwitch] ]\n []\n"
})
}), "\n", _jsx(_components.h2, {
id: "description",
children: "DESCRIPTION"
}), "\n", _jsx(_components.p, {
children: "Will multithread any command/cmdlet/function you specify."
}), "\n", _jsx(_components.h2, {
id: "examples",
children: "EXAMPLES"
}), "\n", _jsx(_components.h3, {
id: "example-1",
children: "EXAMPLE 1"
}), "\n", _jsx(_components.pre, {
children: _jsx(_components.code, {
className: "language-powershell",
children: "Start-CommandMultiThreaded Clear-Space (gc c:\Scripts\comps.txt)\n"
})
}), "\n", _jsx(_components.p, {
children: "Will run the Clear-Space command against nine of the computers in the comps.txt file at a time.\nThis is because the -MaxThreads parameter isn't set so it runs at the default of 9 objects at a time."
}), "\n", _jsx(_components.h3, {
id: "example-2",
children: "EXAMPLE 2"
}), "\n", _jsx(_components.pre, {
children: _jsx(_components.code, {
className: "language-powershell",
children: "gc c:\Scripts\comps.txt | Start-CommandMultiThreaded Clear-Space\n"
})
}), "\n", _jsx(_components.p, {
children: "Will run the Clear-Space command against nine of the computers in the comps.txt file at a time.\nThis is because the -MaxThreads parameter isn't set so it runs at the default of 9 objects at a time."
}), "\n", _jsx(_components.h3, {
id: "example-3",
children: "EXAMPLE 3"
}), "\n", _jsx(_components.pre, {
children: _jsx(_components.code, {
className: "language-powershell",
children: "Start-CommandMultiThreaded -Command Get-Service -Objects (gc c:\Scripts\comps.txt) -AddParameter @{"Name" = "wuauserv"} -AddSwitch @('RequiredServices','DependentServices')\n"
})
}), "\n", _jsx(_components.p, {
children: "Will get the service "wuauserv" and it's dependent/required services from the computers listed in comps.txt."
}), "\n", _jsx(_components.h3, {
id: "example-4",
children: "EXAMPLE 4"
}), "\n", _jsx(_components.pre, {
children: _jsx(_components.code, {
className: "language-powershell",
children: "Start-CommandMultiThreaded -Command Set-AxwayConfig -Objects COMP1,COMP2 -AddParameter @{"ConfigFile" = "C:\PKI\MyOrgsAxwayConfig.txt"}\n"
})
}), "\n", _jsx(_components.p, {
children: "Will set the Axway config file on both the computer COMP1 and COMP2 at the same time using C:\PKI\MyOrgsAxwayConfig.txt on those computers as the file to import."
}), "\n", _jsx(_components.h2, {
id: "parameters",
children: "PARAMETERS"
}), "\n", _jsx(_components.h3, {
id: "-addparameter",
children: "-AddParameter"
}), "\n", _jsx(_components.p, {
children: "Allows specifying additional parameters beyond what is used in Objects.\nNeed to format in a hash table.\nEx:\n@{"ParameterName" = "Value"}\nor\n@{"ParameterName" = "Value";"AnotherParameter" = "AnotherValue"}"
}), "\n", _jsx(_components.pre, {
children: _jsx(_components.code, {
className: "language-yaml",
children: "Type: Hashtable\nParameter Sets: (All)\nAliases:\n\nRequired: False\nPosition: 6\nDefault value: None\nAccept pipeline input: False\nAccept wildcard characters: False\n"
})
}), "\n", _jsx(_components.h3, {
id: "-addswitch",
children: "-AddSwitch"
}), "\n", _jsx(_components.p, {
children: "Allows specifying additional switches to add to the command you run.\nNeed to format in a single string or an array of strings.\nEx:\n"TotalCount"\nor\n@("TotalCount","All")"
}), "\n", _jsx(_components.pre, {
children: _jsx(_components.code, {
className: "language-yaml",
children: "Type: Array\nParameter Sets: (All)\nAliases:\n\nRequired: False\nPosition: 7\nDefault value: None\nAccept pipeline input: False\nAccept wildcard characters: False\n"
})
}), "\n", _jsx(_components.h3, {
id: "-command",
children: "-Command"
}), "\n", _jsx(_components.p, {
children: "Where you specify the command you want to multithread."
}), "\n", _jsx(_components.pre, {
children: _jsx(_components.code, {
className: "language-yaml",
children: "Type: String\nParameter Sets: (All)\nAliases:\n\nRequired: False\nPosition: 1\nDefault value: None\nAccept pipeline input: False\nAccept wildcard characters: False\n"
})
}), "\n", _jsx(_components.h3, {
id: "-maxthreads",
children: "-MaxThreads"
}), "\n", _jsx(_components.p, {
children: "The maximum threads to run.\nCan cause resource issues."
}), "\n", _jsx(_components.pre, {
children: _jsx(_components.code, {
className: "language-yaml",
children: "Type: Int32\nParameter Sets: (All)\nAliases:\n\nRequired: False\nPosition: 3\nDefault value: 9\nAccept pipeline input: False\nAccept wildcard characters: False\n"
})
}), "\n", _jsx(_components.h3, {
id: "-maxtime",
children: "-MaxTime"
}), "\n", _jsx(_components.p, {
children: "The amount of seconds to run the script after last job (object) is started."
}), "\n", _jsx(_components.pre, {
children: _jsx(_components.code, {
className: "language-yaml",
children: "Type: Int32\nParameter Sets: (All)\nAliases:\n\nRequired: False\nPosition: 4\nDefault value: 300\nAccept pipeline input: False\nAccept wildcard characters: False\n"
})
}), "\n", _jsx(_components.h3, {
id: "-objects",
children: "-Objects"
}), "\n", _jsx(_components.p, {
children: "The arguments that are provided to the command.\nGenerally used for specifying the name of one or more computers.\nHowever, it can be used for specifying other arguments such as a list of users."
}), "\n", _jsx(_components.pre, {
children: _jsx(_components.code, {
className: "language-yaml",
children: "Type: String[]\nParameter Sets: (All)\nAliases:\n\nRequired: False\nPosition: 2\nDefault value: None\nAccept pipeline input: True (ByPropertyName, ByValue)\nAccept wildcard characters: False\n"
})
}), "\n", _jsx(_components.h3, {
id: "-sleeptimer",
children: "-SleepTimer"
}), "\n", _jsx(_components.p, {
children: "The amount of milliseconds between each time the script checks the status of jobs.\nFor high resource utilization on the system or if the script is going to take longer to run, this should be increased."
}), "\n", _jsx(_components.pre, {
children: _jsx(_components.code, {
className: "language-yaml",
children: "Type: Int32\nParameter Sets: (All)\nAliases:\n\nRequired: False\nPosition: 5\nDefault value: 500\nAccept pipeline input: False\nAccept wildcard characters: False\n"
})
}), "\n", _jsx(_components.h3, {
id: "commonparameters",
children: "CommonParameters"
}), "\n", _jsxs(_components.p, {
children: ["This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see ", _jsx(_components.a, {
href: "http://go.microsoft.com/fwlink/?LinkID=113216",
children: "about_CommonParameters"
}), "."]
}), "\n", _jsx(_components.h2, {
id: "inputs",
children: "INPUTS"
}), "\n", _jsx(_components.h3, {
id: "systemmanagementautomationpsobjectsystemstring",
children: "System.Management.Automation.PSObject.System.String"
}), "\n", _jsx(_components.h2, {
id: "outputs",
children: "OUTPUTS"
}), "\n", _jsx(_components.h3, {
id: "systemmanagementautomationpscustomobject",
children: "System.Management.Automation.PSCustomObject"
}), "\n", _jsx(_components.h2, {
id: "notes",
children: "NOTES"
}), "\n", _jsx(_components.p, {
children: "Author: Skyler Hart\nCreated: Sometime before 2017-08-07\nLast Edit: 2022-09-05 22:19:49\nOther:"
}), "\n", _jsx(_components.h2, {
id: "related-links",
children: "RELATED LINKS"
}), "\n", _jsx(_components.p, {
children: _jsx(_components.a, {
href: "https://docs.keldor.dev",
children: "https://docs.keldor.dev"
})
})]
});
}
export default function MDXContent(props = {}) {
const {wrapper: MDXLayout} = {
..._provideComponents(),
...props.components
};
return MDXLayout ? _jsx(MDXLayout, {
...props,
children: _jsx(_createMdxContent, {
...props
})
}) : _createMdxContent(props);
}