...
$Bitness = (Get-wmiobject win32_operatingsystem).OSarchitecture
is better to use as it stores the string found in "OSarchitecture" instead of storing the whole object.
Environment Variables
Much like, Command Line, Powershell uses Environment Variables but in a slightly different way. Environment Variables look like variables in structure, $env:SystemRoot, but use a colon.
Get-ChildItem env:
Use the above line to view the current Environment Variables.
Pipeline
Most of Powershell's commands have an output which can be transferred directly to another command. Below is a simple example.
...