I'm trying to set the system folder path in the $SystemFolder array. However, the code gives error.
$Arch = (Get-WmiObject -Class Win32_OperatingSystem).OSArchitecture
If ($Arch -eq "64-bit") {
$SystemFolder = "$env:SystemRoot\SysWOW64"
}
ElseIf ($Arch -eq "32-bit") {
$SystemFolder = "$env:SystemRoot\System32"
}
The array $SystemFolder remains $null!
I suspect the error is related to the idea that I put an array inside a conditional if statement. (I'm not sure)
I am confused, because the code is very simple, and it looks correct.
I really appreciate anyone trying to help me.