|
Re: How can I ensure that a variable is a built-in powershell variable? The only way currently to find an exhaustive list is the documentation:
"get-help about_automatic_variables." Other than that, we do not currently
attach any metadata to them.
--
Lee Holmes [MSFT]
Windows PowerShell Development
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
"Sung M Kim" <DontBotherMeWithSpam@gmail.com> wrote in message
news:1158753822.808445.112870@b28g2000cwb.googlegroups.com...
> 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
> |