Search

System.NullReferenceException with $ExecutionContext.InvokeCommand.ExpandString by Dardenne Laurent

Active

3
0
Sign in
to vote
Type: Bug
ID: 779964
Opened: 2/25/2013 11:12:08 AM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
Impossible to use a member in a $() group into a call to expandString.
Details (expand)
How often does this happen?
Always Happens

Have you seen this problem before in this product?

No, this is new to the most recent version
Reproduction Steps
$S='One'
$Ht=@{Name='KeyName'}

$ExecutionContext.InvokeCommand.ExpandString('Result=$($S.ToUpper())')
#Exception lors de l'appel de «ExpandString» avec «1» argument(s):
#«La référence d'objet n'est pas définie à une instance d'un objet.»

$ExecutionContext.InvokeCommand.ExpandString('Result=$($Ht.Name)')
#Exception lors de l'appel de «ExpandString» avec «1» argument(s):
#«La référence d'objet n'est pas définie à une instance d'un objet.»

Under PS v3, Seven Fr.
Expected Results
'Result=ONE'

'Result=KeyName'
File Attachments
0 attachments
Sign in to post a comment.
Sign in to post a workaround.