Advanced PowerShell - Runspaces

  Рет қаралды 9,031

Adam Driscoll

Adam Driscoll

Күн бұрын

Пікірлер: 11
@JB-tq1ly
@JB-tq1ly 2 жыл бұрын
Thanks for sharing with us Adam! I do also appreciate Universal Dashboard !
@RAMChiTribe
@RAMChiTribe 2 жыл бұрын
I use your visual studio forms tool to create a form and I use the concepts in this video to control that form. I am making windows apps for selenium automation. Much respect.
@charliesherman7533
@charliesherman7533 5 ай бұрын
Hi Adam, Thanks for this. Question. If I have 2 window forms running in their own runspaces. How can I close and dispose the 2nd window thru a button or an event in the 1st window?
@space_0027
@space_0027 2 жыл бұрын
This is really cool. Thanks for sharing!
@HumanNamedNick
@HumanNamedNick Жыл бұрын
Another cool little shortcut is if you do not specify a runspace for your powershell object, a new one is created for you: $PowerShell = [powershell]::Create() $PowerShell.AddScript("Get-ChildItem") # after running this, while the code isn't invoked, a new runspace is created. if you null out the variable or remove it, from what I can tell, it also disposes that runspace which is kind of neat. Runspaces can help you overcome some unique problems.
@ThisGuyDakota
@ThisGuyDakota 2 жыл бұрын
Just wondering, why do the variables in the addscript method need a backtick? It feels like it should be escaping the dollar sign as a variable 🤔
@TheDJRiffin
@TheDJRiffin 6 ай бұрын
My first thought is that if you didn't have the back tick it would look for that variable in the current scope. But we only want the variable in that instance of the powershell object. Then we invoke it. If we just had the variable in the 'addscript' without the back tick and without the invoke, it may look for the variable, not find it and then not end up parsing the name of the variable into the powershell instance. (either by returning an error to the user, or parsing a null value, or parsing a value from our current scope instead of just the name of the variable.)
@kevinalbrecht
@kevinalbrecht 2 жыл бұрын
What version does invokeAsync start being supported?
@AdamDriscoll
@AdamDriscoll 2 жыл бұрын
Not 100% sure exactly what version but it's not available in WinPS 5.1. You'll need to use BeginInvoke instead: docs.microsoft.com/en-us/dotnet/api/system.management.automation.powershell.begininvoke?view=powershellsdk-1.1.0
@kevinalbrecht
@kevinalbrecht 2 жыл бұрын
@@AdamDriscoll Awesome, thanks for taking the time to reply Adam!
Run PowerShell in .NET
7:58
Adam Driscoll
Рет қаралды 9 М.
PowerShell Performance: .NET Collections
12:35
Adam Driscoll
Рет қаралды 2,2 М.
Human vs Jet Engine
00:19
MrBeast
Рет қаралды 110 МЛН
DID A VAMPIRE BECOME A DOG FOR A HUMAN? 😳😳😳
00:56
啊?就这么水灵灵的穿上了?
00:18
一航1
Рет қаралды 72 МЛН
Debugging PowerShell Scripts in Visual Studio Code
22:16
Adam Driscoll
Рет қаралды 15 М.
Runspaces - Lets Work in Parallel
56:44
Guy Leech
Рет қаралды 1,5 М.
Running PowerShell code  as background tasks with PowerShell jobs
15:30
Mike in the Cloud
Рет қаралды 2,4 М.
PowerShell Quick Tips : Start-Job
17:16
JackedProgrammer
Рет қаралды 2,5 М.
PowerShell Master Class - Automation
46:06
John Savill's Technical Training
Рет қаралды 28 М.
PowerShell Basics - Strings
24:20
Adam Driscoll
Рет қаралды 2,7 М.
WPF and PowerShell Ep7 Runspaces part 1
18:38
Jim Moyle
Рет қаралды 9 М.
Human vs Jet Engine
00:19
MrBeast
Рет қаралды 110 МЛН