Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 8583

Problem with typed variables

$
0
0

 

 

Hi,

url of page : http: //powershell.com/cs/blogs/ebookv2/archive/2012/02/02/chapter-3-variables.aspx#examining-strongly-typed-variables

 

 

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
TypeId
------
System.Management.Automation.ArgumentTypeConverterAttribute
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

 


Viewing all articles
Browse latest Browse all 8583

Trending Articles