Тёмный

Advanced PowerShell - Runspaces 

Adam Driscoll
Подписаться 4,4 тыс.
Просмотров 9 тыс.
50% 1

In this video, I go through a primer on runspaces. I got through creating runspaces and running scripts synchronously and asynchronously. I also initialize a runspace with a variable, create an out of process runspace and connect to another PowerShell process using named pipes.
This video is part of my PowerShell training course. Code and other courses can be found here: ironmansoftwar...

Опубликовано:

 

17 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 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.
@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.
@charliesherman7533
@charliesherman7533 4 месяца назад
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 5 месяцев назад
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
Просмотров 9 тыс.
For my passenger princess ❤️ #tiktok #elsarca
00:24
PowerShell Advanced Functions
9:48
Просмотров 4,2 тыс.
WPF and PowerShell Ep7 Runspaces part 1
18:38
Просмотров 8 тыс.
Call REST APIs with Invoke-RestMethod in PowerShell
30:02
For my passenger princess ❤️ #tiktok #elsarca
00:24