309 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
2
votes
3
answers
260
views
PowerShell + WPF: Background worker and interacting with UI
I'm currently building a GUI application using PowerShell and WPF, and overall, I'm quite pleased with how easy it is to spin up a user interface for small tools without having to dive into full-blown ...
2
votes
2
answers
117
views
I can't close the form from another thread
I've tried different ways to call the form's close method. The code below seems the most optimal to me, but it doesn't work as expected.
I'd also like to avoid using Start-ThreadJob, as it requires ...
0
votes
1
answer
83
views
How can I update a Powershell gui textbox from another thread?
I've tried variations of the below code without success, it both freezes the GUI and does not write to the textbox and update it. I'm not sure why it is freezing the UI as a thread. (I've seen some ...
1
vote
0
answers
43
views
Why doesn't the error stream from a runspace created with $Host appear in the console? [duplicate]
Consider the following PowerShell which writes to each of the (non-output) streams in the current runspace, then does the same in another runspace created with $Host:
$sb = {
$DebugPreference = '...
1
vote
1
answer
48
views
Can a new PowerShell class instance be created in an already-running remote PowerShell process from Windows PowerShell?
There are some useful things that can be accomplished by connecting to an already-running PowerShell process. This answer, for example, uses that technique to gracefully stop the target PowerShell ...
1
vote
2
answers
152
views
How can I detect that a scriptblock is bound to the SessionState of another Runspace?
Consider the following code
foreach ($i in 1..100) {
$sb = {'bound_to_parent_runspace'}
. $sb | Out-Null
1..2 |
ForEach-Object {
Start-ThreadJob `
-...
0
votes
0
answers
107
views
Why does my powershell runspace not increase performance?
so basically, i am looking at doing a comparison between accounts we have in Active Directory and a csv which lists all active accounts (~15000 lines). This process would be ran weekly.
The issue that ...
0
votes
0
answers
107
views
Powershell script with runspace
I have a script that uses windows forms and runspace. I can't realize that after clicking on "Clean Now" button my gif picture would keep rotating and after ExitCode 0 I would get Show-...
1
vote
1
answer
215
views
Powershell generating output in the error stream instead of output stream
I have a C# application that creates a remote runspace, creates a powershell instance inside the runspace and executes a perl script using
ps.AddScript($"perl.exe {perlScriptPath} {perlScriptArgs}...
0
votes
1
answer
274
views
The code hangs my current session. How do I dispose the form and end the Runspace and Powershell session?
Everything seems ito work correctly in my code except that I cannot seem to get the correct sequence of statements to close a form, the Runspace, and the Powershell session. The code creates the ...
1
vote
1
answer
91
views
C# can't convert from string to runspacemode?
So writing a C# program that uses a powershell script as follows
PowerShell allowtorthroughwindowsfirewallinbound = PowerShell.Create("New - NetFirewallRule - DisplayName Allow TOR through ...
user avatar
user24983509
1
vote
1
answer
156
views
What's the default PSHost implementation (for use in a RunspacePool)?
I'm trying to create a RunspacePool with an initial session state and a count of min/max runspaces. However, the only constructor on RunspaceFactory that supports all those parameters also requires a ...
0
votes
0
answers
100
views
Powershell GUI, GIF and Runspaces
I currently have a GUi that works with a zip file, that contains a few thousand .zip files of .csv data
My script currently works correctly, but im looking to add a gif that is displayed while the job ...
0
votes
1
answer
170
views
Powershell class can't call its own methods when invoked from runspace
I'm facing a weird bug where my custom class can't seem to be able to call its own functions (static or not) when it is invoked from a runspace (so, when one of its methods is called from a runspace, ...
0
votes
1
answer
63
views
PowerShell Toggle Button for Background Job Report Generation
i would like create a Generate-SummaryReports-CalculateAtIntervals toggle button which it is a background job that can be like a switch that can be turn on and off which allow the Generate-...