Back
Close

Computing with Data

elgeish
84.3K views

PowerShell - Variables

Sometimes piping isn't enough; we need variables to store, manipulate, and read data. Variables in PowerShell are objects; variable names have to start with a $ as the examples below demonestrate:

# Assign the value 13 to $var then read it
$var = 13
$var
## 13
# Assign the value 42 to ${a$b} then read it
${a$b} = 42
${a$b}
## 42
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io
codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants