Scripting with PowerShell Runspaces
A great deal of what we do in PowerShell is based on the use of runspaces. These are are configured containers, not in the Docker sense, that allow us to run PowerShell commands. Normally, we never have to think about them. But they are there. If you open a clean PowerShell session, there is always at least one runspace.
PS C:\> Get-Runspace
Id Name ComputerName Type State Availability
-- ---- ------------ ---- ----- ------------
1 Runspace1 localhost Local Opened Busy
Fortunately, you don't have to do anything with this. When you run a job command, or Invoke-Command
, PowerShell will create additional runspaces. Again, you don't have to worry about this. PowerShell will manage the runspaces for you.
Want to read the full issue?