0
我试图做一个非常简单的代码来检测笔记本电脑架构。以下是代码。我的笔记本电脑是64位的,但它也会显示32位的消息框。是否还有其他遗漏代码?检测系统架构
#Load assembly
add-type -assemblyname system.windows.forms
#Assign messagebox to variable
$message1 = [System.Windows.Forms.MessageBox]::Show("This is a 64 bit version" , "Status")
$message2 = [System.Windows.Forms.MessageBox]::Show("This is a 32 bit version" , "Status")
#Display message based on the architecture
if ([System.Environment]::Is64BitProcess) {
echo $message1
} else {
echo $message2
}