Pester Mocking a script that varies output

Hi Anthony, HKLM:\Software\WOW6432Node\This is Testing this will get changed when I run the same in 32 bit so how can I validate the test case

Well first off in your function I would be checking for the OS version. If it’s 32 bit write the 32 bit registry and if it’s 64bit write the 64bit registry. In your function you could use

(Get-WmiObject Win32_OperatingSystem).OSArchitecture
to determine the OS version then mock Get-WmiObject to either return 32-bit or 64-bit