Problem with typed variables

by Mar 11, 2013




url of page : http: //



Examining Strongly Typed Variables.


Once you assign a specific data type to a variable as shown above, PowerShell will add this information to the variable attributes. .

If you delete the Attributes property, the variable will be unspecific again so in essence you remove the strong type again:

# List attributes and delete:
(Get-Variable a).Attributes
How do you have these information "TypeId" because I try with an example and nothing.
My example : Set-Variable -name exemple -value 26 -Option ReadOnly
and when I do (get-variable exemple).Attributes I have nothing, I don't understand how run this command.
Best regards