Functions/Get-FpsComputerInfo.ps1
function Get-FpsComputerInfo { $OperatingSystem = Get-WmiObject -Class Win32_OperatingSystem $Processor = Get-WmiObject Win32_Processor # Calculate total available CPU Cores $TotalCPUCores = 0 $Processor.NumberOfCores | ForEach-Object {$TotalCPUCores += $_ } # Calculate total available CPU threads $TotalCPUThreads = 0 $Processor.ThreadCount | ForEach-Object {if($_){ $TotalCPUThreads += $_ }} if ($TotalCPUThreads -eq 0){$TotalCPUThreads = $TotalCPUCores} # Create custom PowerShell object with system information $SystemInfo = New-Object psobject -Property ([ordered] @{ 'ComputerName' = hostname 'DomainName' = $env:USERDNSDOMAIN 'OSName' = $OperatingSystem.Caption 'OSVersion' = $OperatingSystem.Version 'PSVersion' = $PSVersionTable.PSVersion.ToString() 'TotalMemoryGB' = [math]::round($OperatingSystem.TotalVisibleMemorySize/1024/1024) 'CPUName' = ($Processor | Select-Object -First 1).Name 'TotalCPUSocket' = ($Processor | Measure-Object).Count 'TotalCPUCores' = $TotalCPUCores 'TotalCPUThreads'= $TotalCPUThreads }) return $SystemInfo } Export-ModuleMember -Function Get-FpsComputerInfo |