
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Get Variable Data Type in PowerShell
There are different data types exist for the variable like Byte, Int32, Float, String, etc. To get the variable type, we need to use the GetType() method.
Example
$x = 10 $x.GetType()
Output
IsPublic IsSerial Name BaseType -------- -------- ---- -------- True True Int32 System.ValueType
To get only the variable datatype use Name property.
$x.GetType().Name
Int32
Advertisements