I’ve started to automate a ton of things in our environment using PowerCLI (VMware). Unfortunately some of the cmdlets require a 32bit powershell, in order to protect vCenter from bugs via running the script as a 64 bit process I have had to implement a way to make sure it was run as 32bit. Im sure this can be handled a few different ways but this is working great so far.
1 2 3 4 5 6 7 8 |
$is32bitcheck = ([Environment]::Is64BitProcess) if ($is32bitcheck -eq $true) { Write-Host "PowerShell was not opened as 32bit process, please open as 32bit process!" -ForegroundColor red -backgroundcolor black Write-Host "Press any key to continue ..." $x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") Exit } |