44)
55
66$ModuleName = ' SqlServer-Version-Management' ;
7- $ModuleVersion = ' 2.1.184 ' ;
7+ $ModuleVersion = ' 2.1.185 ' ;
88$ModuleFiles = @ (
99 @ {
1010 FileName = ' SqlServer-Version-Management\SqlServer-Version-Management.psd1' ;
@@ -15,7 +15,7 @@ $ModuleFiles = @(
1515 " ModuleToProcess = @('SqlServer-Version-Management.psm1')" ,
1616 " " ,
1717 " # Version below is automatically incremented on build" ,
18- " ModuleVersion = `" 2.1.184 `" " ,
18+ " ModuleVersion = `" 2.1.185 `" " ,
1919 " " ,
2020 " GUID = 'dd03b53d-575a-4056-ae08-e6dfea3384ea'" ,
2121 " " ,
@@ -764,6 +764,8 @@ $ModuleFiles = @(
764764 " " ,
765765 " # x86 (0), MIPS (1), Alpha (2), PowerPC (3), ARM (5), ia64 (6) Itanium-based systems, x64 (9), ARM64 (12)" ,
766766 " function Get-CPU-Architecture-Suffix-for-Windows-Implementation() {" ,
767+ " `$ ret = Get-OS-Architecture-by-Registry" ,
768+ " if (`$ ret) { return `$ ret; }" ,
767769 " # on multiple sockets x64" ,
768770 " `$ proc = Select-WMI-Objects `" Win32_Processor`" ;" ,
769771 " `$ a = (`$ proc | Select -First 1).Architecture" ,
@@ -790,6 +792,25 @@ $ModuleFiles = @(
790792 " return `$ Global:CPUArchitectureSuffixforWindows" ,
791793 " }" ,
792794 " " ,
795+ " function Get-OS-Architecture-by-Registry {" ,
796+ " `$ regPath = `" HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment`" " ,
797+ " `$ valueName = `" PROCESSOR_ARCHITECTURE`" " ,
798+ " `$ rawArch = `$ null" ,
799+ " " ,
800+ " try {" ,
801+ " if (Test-Path `$ regPath) { `$ rawArch = (Get-ItemProperty -Path `$ regPath -Name `$ valueName -ErrorAction SilentlyContinue).`$ valueName }" ,
802+ " } catch { `$ rawArch = `$ null }" ,
803+ " " ,
804+ " switch (`$ rawArch) {" ,
805+ " `" AMD64`" { return `" x64`" }" ,
806+ " `" x86`" { return `" x86`" }" ,
807+ " `" ARM64`" { return `" arm64`" }" ,
808+ " `" ARM`" { return `" arm`" }" ,
809+ " `" IA64`" { return `" ia64`" }" ,
810+ " `" EM64T`" { return `" x64`" }" ,
811+ " }" ,
812+ " }" ,
813+ " " ,
793814 " # Include File: [\Includes\Get-Cpu-Name.ps1]" ,
794815 " function Get-Cpu-Name-Implementation {" ,
795816 " `$ platform = Get-Os-Platform" ,
@@ -4281,6 +4302,7 @@ $ModuleFiles = @(
42814302 " Export-ModuleMember -Function Get-Aria2c-Exe-FullPath-for-Windows" ,
42824303 " Export-ModuleMember -Function Get-Builtin-Windows-Group-Name" ,
42834304 " Export-ModuleMember -Function Get-CPU-Architecture-Suffix-for-Windows" ,
4305+ " Export-ModuleMember -Function Get-OS-Architecture-by-Registry" ,
42844306 " Export-ModuleMember -Function Get-Cpu-Name" ,
42854307 " Export-ModuleMember -Function Get-Folder-Size" ,
42864308 " Export-ModuleMember -Function Get-Full7z-Exe-FullPath-for-Windows" ,
0 commit comments