I currently use $ExecutionContext.InvokeCommand.ExpandString (…) to perform a flexible variable expansion. Of course, this method has access to all variables in the current execution context.
What I’d like to do is limit the substitution to only a specified set of variables.
Short of writing my own substitution function, is there any way of achieving this with ExpandString? Does anyone have alternative suggestions?
submitted by /u/geggleau
[link] [comments]
The post ExpandString for a limited set of variables appeared first on How to Code .NET.