I deal with a mix of 32-bit and 64-bit clients, so I'm finding that some scripts fail due to null values for some variables. One of these is likely the programfiles dir. I noticed the sample script assumes a 64-bit platform - is there a better (more dynamic) way to handle setting these variables that accounts for architecture without creating a lot of if statements?
example (assumes 64-bit):
$dirOffice = Join-Path "${env:ProgramFiles(x86)}" "Microsoft Office"
example (assumes 64-bit):
$dirOffice = Join-Path "${env:ProgramFiles(x86)}" "Microsoft Office"