AMA: Can PowerShell “Go Inside” a Service?

Javier writes:

Suppose I have a Windows service in a productive environment that does some kind of work. It’s secured and everything, and I have a very limited way of interact with it to maybe adjust its configuration or perform a maintenance work on it.

I thought it would be awesome if I could use Powershell to tap into that services and be able to check for internal objects and maybe change some configuration on the fly.

The idea would be to host a Powershell inside the service, easy job, create a runspace and a pipeline in which specific objects are exposed in the form of variables, no problem, and then be able to run Powershell code in that pipeline.

Easy done if the service had a GUI or if it was interactive in some way so it would just ask for an input, and I could push that input into the pipeline and maybe display the info from the returned PSObject. But, no GUI at all and neither I would like for it to have it. I made a proof of concept using a REST kind of interface to pass along the powershell code and execute it in the pipeline, and the look of it was really promising.

Now, since Powershell is built thinking of remoting, I was wondering if there could be some way of creating a remote session to invoke commands but not on the Powershell environment of the computer, but in the pipeline of the Powershell hosted inside my windows service.

There are tons of examples of Powershell self hosting applications but none takes remoting into consideration, from the server perspective. I’m not sure what was the intention in being able to host a powershell engine on a .NET application, but I think it would only be natural if I could initiate a remote connection to that engine, don’t you?

I don’t know if I’m terribly misguided. If that would be the case, what would be in your opinion the best way to use Powershell to interact with a windows service? Something like the way we use powershell to interact and configure Exchange for example.

I hope you’ll ask a question, too! Visit here for info.

Read More

Trying to “Give Back?” Don’t Overthink It.

This:

Screen Shot 2018-05-25 at 11.12.26 AM.png

From the PowerShell Facebook group.

I think everyone views “blogging” as “writing a book” and it doesn’t need to be. It’s electronic. It’s short-form. I often use blog posts as a way of getting my thoughts in order and gathering feedback, prior to writing something more “permanent” like a book.

Rodney, thanks for posting that on Facebook ;). I hope lots of folks realize that they can “give back” without it needing to be a major weeks-long effort. Just share the process!

 

AMA: Will DSC Make It?

Jeremy writes:

With dsc headed for it’s third major rewrite in nearly as many years, is it something that you think will turn into a fully fleshed out and complete product? Or will it just end up as an interesting footnote that never found its place? Or something different altogether?

I hope you’ll ask a question, too! Visit here for info.

Read More

AMA: Benefit or Service?

Drew asks:

Do you consider Health insurance a benefit or a service?

I equate benefits as no cost and services something I pay for…

I hope you’ll ask a question, too! Visit here for info.

Read More