Advanced PowerShell - Runspaces

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

Adam Driscoll

Adam Driscoll

Күн бұрын

Пікірлер: 12
@freshmaker4o
@freshmaker4o 23 күн бұрын
A lot of food for thought, thanks!
@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.
@HumanNamedNick
@HumanNamedNick 2 жыл бұрын
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.
@space_0027
@space_0027 2 жыл бұрын
This is really cool. Thanks for sharing!
@charliesherman7533
@charliesherman7533 8 ай бұрын
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?
@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 9 ай бұрын
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
Рет қаралды 10 М.
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН
Леон киллер и Оля Полякова 😹
00:42
Канал Смеха
Рет қаралды 4,7 МЛН
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН
Powershell Advanced Tools and Scripting Full  Course
6:00:56
Nerd's lesson
Рет қаралды 208 М.
Why You Shouldn't Nest Your Code
8:30
CodeAesthetic
Рет қаралды 2,8 МЛН
Dynamic Parameters in PowerShell Functions
8:35
ITPro Today
Рет қаралды 757
Running PowerShell code  as background tasks with PowerShell jobs
15:30
Mike in the Cloud
Рет қаралды 2,9 М.
PowerShell Quick Tips : Start-Job
17:16
JackedProgrammer
Рет қаралды 2,6 М.
PowerShell Modules
25:01
TechThoughts
Рет қаралды 14 М.
PowerShell Tutorials : Data Tables
13:43
JackedProgrammer
Рет қаралды 9 М.
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН