Quantcast
Channel: /r/powershell – How to Code .NET
Viewing all articles
Browse latest Browse all 8793

ExpandString for a limited set of variables

$
0
0

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.


Viewing all articles
Browse latest Browse all 8793

Trending Articles