![]() Notice that we have a different type (name and base type) for this object’s properties. Now, what if we wanted to store all email addresses for a mailbox. Notice that the type of variable we have now is a very specific ‘SmtpAddress”. We then use the ‘.GetType()’ to see what variable type is set with this data storage. The value for the PrimarySMTPAddress will be stored in a variable called $SMTP. First, we have a query for the Administrator mailbox’s Primary SMTP Address. Now, let’s take a look at some real world examples. ![]() Now, we can convert the type to a string if we do not need that particular data type. Notice that the type is ‘DateTime’ which is logical considering what could pulled from Get-Date. We can store this information in a variable and then see how that data is being stored/interpreted by PowerShell: Get-Date pulls your current date and time information from your computer. Sometimes this can be key to how we handle the data on the variable or how we can display or search for information in the variable. Variables can contain numbers, strings and more.
0 Comments
Leave a Reply. |