start-job Questions
1
Solved
I'm using the below code to display the results of PowerShell Jobs with a timeout of 120 seconds. I would like to enhance this code by incorporating Write-Progress (based on number of jobs complete...
Censorious asked 19/4, 2022 at 0:8
1
Solved
Assuming Get-Foo and Get-Foo2 and Deploy-Jobs are 3 functions that are part of a very large module. I would like to use Get-Foo and Get-Foo2 in Deploy-Jobs's Start-ThreadJob (below) without reloadi...
Salem asked 15/4, 2022 at 1:4
1
Please have a look at this test script and the conclusions I've made about how 'Receive-Job' works in detail.
I have still issues to figure out, how exactly 'Receive-Job' pulls the streams from the...
Banuelos asked 24/6, 2018 at 22:32
3
Solved
within powershell I'd like to learn the best way to call a variable to a start job so I don't have to edit the script for each server as it will be specific based on the client I've placed my scrip...
Prolix asked 9/4, 2012 at 15:59
1
Solved
I have a long script. i have a function for logging:
function Log ([string]$Content){
$Date = Get-Date
Add-Content -Path $LogPath -Value ("$Date : $Content")
}
In some point at the scr...
Billiton asked 22/8, 2021 at 12:15
4
Solved
I would like to time my background jobs (started with start-job) and time them out after x seconds. I find it hard however to keep track of the running time on each separate job (I am running aprox...
Desilva asked 18/3, 2012 at 8:8
3
Solved
I saw this question and this question but couldn't find solution to my problem.
So here is the situation:
I have two functions DoWork and DisplayMessage in a script (.ps1) file. Here is the code: ...
Tudela asked 20/3, 2013 at 10:2
1
I'm having issues using Start-Process within a Start-Job, specifically when using -NoNewWindow. For example, this test code:
Start-Job -scriptblock {
Start-Process cmd -NoNewWindow -Wait -Argumen...
Squatter asked 11/7, 2014 at 3:12
7
Solved
I have a script that reads a configuration file that results in a set of name value pairs that I would like to pass as arguments to a function in a second PowerShell script.
I do not know what para...
Proclus asked 12/10, 2012 at 0:12
1
I developed some custom cmdlets that serve for different importing tasks to a SharePoint system. Currently all those cmdlets are being run in a serial kind in a single PowerShell script. I want to ...
Wagers asked 26/11, 2015 at 10:41
6
Solved
Is there a way to specify a working directory to the Start-Job command?
Use-case:
I'm in a directory, and I want to open a file using Emacs for editing. If I do this directly, it will block Power...
Marivaux asked 8/2, 2010 at 19:42
5
Solved
Overview
Looking to call a Powershell script that takes in an argument, runs each job in the background, and shows me the verbose output.
Problem I am running into
The script appears to run, but...
Neotropical asked 22/3, 2013 at 21:24
2
Solved
I'm trying to do basic background jobs in PowerShell 2.0, and I'm seeing different things with start-job and invoke-command -asjob.
If I do this:
start-job -scriptblock {get-process}
I get a job...
Matheny asked 12/11, 2009 at 22:9
4
Solved
I'm trying to execute a cmd file on a list of 48 computers. I don't want to execute and wait for completion sequentially because each cmd takes about 10 minutes to complete. WinRM isn't an option. ...
Hyetal asked 1/7, 2010 at 0:51
1
Solved
I have a powershell script that starts a job
start-job -scriptblock {
while($true) {
echo "Running"
Start-Sleep 2
}
}
and then it continues executing the rest of the script.
That job, is k...
Adaurd asked 2/12, 2013 at 18:52
4
Solved
I want to use background jobs in Powershell.
How to make variables evaluated at the moment of ScriptBlock definition?
$v1 = "123"
$v2 = "asdf"
$sb = {
Write-Host "Values are: $v1, $v2"
}
$job ...
Bakery asked 7/11, 2013 at 11:22
2
Solved
I would like to lower the priority of the jobs that I start with Start-Job in PowerShell scripts. Is this possible?
Perdurable asked 21/10, 2012 at 7:12
3
Solved
I created a function "Get-Uptime" in a module sysinfo.psm1 and imported the module.
C:/pstools> get-command -Module sysinfo
CommandType Name Definition
----------- ---- ----------
Fun...
Greenling asked 6/9, 2012 at 5:51
2
Solved
I'm trying to run a job in a background which is a .exe with parameters and the destination has spaces. For example:
$exec = "C:\Program Files\foo.exe"
and I want to run this with parameters:
f...
Bathurst asked 4/1, 2012 at 1:31
1
© 2022 - 2024 — McMap. All rights reserved.