tl;dr Entering a new powershell session seems to create (or reveal) a copy PSWorkflowJob. Explain?
As seen in the elevated code below, I create a simple Workflow and run it as a job. While it is suspended, I enter into a new PS session and the…
I want to get serial numbers of remote PC's with the name of PC, in one table.
$PCNameArray is array of remote PC I want to get serial numbers.
$complete = $false
$arrayJobs = @()
Foreach($a in $PCNameArray) {
$arrayJobs += Get-WmiObject…
I have a script block that when I press a button in a window it gets me the output data back in to a textbox but the issue is that it only gives me the last lines in the output, my question is how can I get the output text concurrently without…
Say I run a powershell job as a user in one window, and then want to retrieve the results in another powershell window;
Is it possible to make it global somehow, so I can pull it up on another machine?
I imagine the answer I'm going to get is…
I am trying to run a fairly simple command on 20 servers in parallel.
What I have so far is this :
$servers = @()
$servers = (
"server1",
"server2",
"server3",
"server4",
"server5",
…
I tried to build an application with windows form with Powershell,
I encountered a problem,
When i run my parent form, i have no problem, i can open a child form but when my child form is open, i can't go back to my parent form, i search on internet…
I am creating a script which checks for disabled user. To shorten the time it takes to find the information for each user I wanted to create jobs which do this in parallel. Put only the first job actually finishes, all other jobs timeout with this…
Is there a nice way to implement the switch parameter -AsJob in custom cmdlets, like Invoke-Command has?
The only way I thought about this is:
function Use-AsJob {
[CmdletBinding()]
[OutputType()]
param (
[Parameter(Mandatory =…
I'm copying files to a USB utilizing the path of the USB (assuming one drive plugged in) rather than the drive letter. I need to do it this way since I'm using this to clone 52 USBs at once.
This is where the prefix for the path is found:
$usb =…
I keep getting this error when I use this cmdlet in my script block
Cannot parse the request.
StatusCode: 400
ReasonPhrase: Bad Request
OperationID : '2410b534-3ab9-4c82-b0fa-233e5a36e795'
+ CategoryInfo : CloseError: (:)…
The variable $var is blank when I run this script:
function FOO { write-output "HEY" }
$var = Start-Job -ScriptBlock { ${function:FOO} } | Wait-Job | Receive-Job
$var
How do I get output from receive-job?
In the company I work for, we wanted to change a timer to an .ini file for around 310 computers, in order to extend this timer.
So I searched around and did find some scripts, but they were not doing exactly what we wanted.
So i sat down googled…