|
Re: How can I ensure that a variable is a built-in powershell variable? Adam Milazzo wrote:
> Sung M Kim wrote:
> > I have a question regarding variables.
> > Is there a way to ensure that retrieved variable such as *Preference
> > variables are indeed a built-in PowerShell variables?(they have "None"
> > as an option for all)
> >
> > I was thinking about checking if a variable is of type
> > "System.Management.Automation.ActionPreference" but can anyone just
> > create a variable with *Preference as postfix and of type
> > "System.Management.Automation.ActionPreference"?
>
> Sure, anybody can, but why not let them?
I was simply trying to retrieve variables that affect PowerShell's
behavior, not the ones that do nothing to how PowerShell works...
And I just wanted to know if there is a way or a flag to check against
for built-in variables |