Variables in PowerShell

  • Use $ to create and use variables
  • Can contain letters, numbers, spaces and underscores
  • Don’t persist after Shell exits
  • New-Variable
  • Set-Variable
  • Get-Variable
  • Clear-Variable
  • Remove-Variable
  • Can force a type – [int]$var