variables contains a data to store. Programming languages provides type safety which means variables holds the specific type of the data.

Powershell offerrs datatypes to dallow type safety for storing the variables.

Syntax:

$variable=[datatype]value

[datatype]$variable=value

datatype is a valid datatype supported in Powershell Scripting

Datatype can be one of the following

  • Inintteger: Represents the whole numbers, example are 1,90
  • Float: Contains precission and decimal numbers, Example are 1.11
  • String: Contains characters and letters, Example are content
  • Boolean: Boolean value such as True or False
  • DateTime: represents date and time stamp
  • arrays ; Collection of elements stored under a single variable
  • hashtable: Stores the key and value pair elements