I want to create a PowerShell script that will be running in the background as some kind of service, let's name it BackEnd.ps1. An additional script (e.g. FrontEnd.ps1) will be started on whenever needed by the user.
The FrontEnd.ps1 script should be able to read / write variables in the BackEnd.ps1 script.
But how could I realize this? Is this possible via Enter-PSHostProcess cmdlet? Enter-PSSession seems not to work for me since I don't know how to retrieve the session from the BackEnd.ps1.
Edit: The question Pipelining between two SEPARATE Powershell processes is not quiet similar to mine. Contrary to that one I would like to exchange objects between the scripts as well. The solution with the pipe only allows to exchange strings.