# PowerShell Variables: Storing Values in Memory ## Introduction A variable is like a labeled box where you store a value. In PowerShell, variables start with `$`. ## Creating a Variable $name = "Bagus" $age = 25 ## Using Variables Write-Host "Hello, $name! You are $age years old." ## Variable Types PowerShell figures out the type automatically: $count = 10 # number $text = "hello" # string $flag = $true # boolean ## Arrays (Lists) $fruits = @("apple","banana","cherry") $fruits[0] # apple ## 3 Things to Remember - Variables start with `$`. - PowerShell auto-detects types. - Use `@(...)` to create arrays.