I am trying to create a couple lines of code that will pull from WMI if a machine is either 32/64 bit and then if it is 64 do this .... if it is 32bit do this...
Can
This is similar to a previous answer but will get a correct result regardless of 64-bit/64_bit/64bit/64bits format.
if ((Get-WmiObject win32_operatingsystem | select osarchitecture).osarchitecture -like "64*") { #64bit code here Write "64-bit OS" } else { #32bit code here Write "32-bit OS" }