I tried to save the text that asks the user in a text file. I wanted to have variables in a text file that were extended from my script.
My settings are stored in PSCustomObject with the name $ profile, so in my text I tried to do something like:
Hello $($profile.First) $($profile.Last)!!!
and then from my script, which I tried to do:
$profile=GetProfile
which of course left me with a mistake
Throw an exception "ExpandString" with argument "1": "The object link is not installed in the object instance."
Finally, I realized that I only need to save the PSCustomObject values ββthat I want in the usual old variables, change the text file to use them instead of the object.property version, and everything worked beautifully:
$profile=GetProfile
And in the text I changed to
Hello $ First $ Last !!!
Mike cheel
source share