jeudi 19 juillet 2018

Saving functions as object and invoke them

I did some research but haven't found anything suitable for my case. Is there a PowerShell native way to save function calls - or in the best case - parameterized function calls as an object in PowerShell to invoke them later on?

I want to queue some of them up and then call them in a row. A way that came to my mind was writing up the calls as strings and Invoking them through Invoke-Expression, but this seems very error prone.

Unfortunately I can't unable to build a class for this purpose because we're using mostly PowerShell v3.0 and it's possibilities with functions. So I'm asking for a built-in / already existent way.





Aucun commentaire:

Enregistrer un commentaire