So I’m trying to use Powershell inside a programm to access Items(basicly internal objects) directly from our Programm. So far I set up a new PSProvider together with a new runspace/host running inside the application.
- I have noticed some Provider-Cmdlets (like get-childitem) allow omitting the path argument and then it uses the Current Path. But most Cmdlets (like get-item) don't have this behaviour. If there is no path provided it prompts to input a path and throws an error if you send nothing. Is there a way to change that behavior in my custom provider so I can get the item at the current Position when using get-item without arguments?
- Is there a way to create remoteaccess to one of my own powershell hosts/runspaces from any default Powershellconsole?
- Would it be possible to access the programm without a host running inside my application? Like just compiling a Module with Cmdlets and the Provider that references classes of the programm and access the programm(if it is running). My assumption was that I would need some kind of api for that but I don't actually know.