-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInfo_do_SO.ps1
28 lines (24 loc) · 1.24 KB
/
Info_do_SO.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
$systemInfo = Get-CimInstance -ClassName Win32_ComputerSystem
$osInfo = Get-CimInstance -ClassName Win32_OperatingSystem
$cpuInfo = Get-CimInstance -ClassName Win32_Processor
$memoryInfo = Get-CimInstance -ClassName Win32_PhysicalMemory
$networkInfo = Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Where-Object { $_.MACAddress -and $_.IPEnabled } | Select-Object -First 1
$totalMemoryBytes = 0
if ($memoryInfo) {
foreach ($mem in $memoryInfo) {
$totalMemoryBytes += $mem.Capacity
}
}
$totalMemoryGB = [math]::Round($totalMemoryBytes / 1GB, 2)
$userName = $env:USERNAME
$macAddress = if ($networkInfo) { $networkInfo.MACAddress } else { "Não encontrado" }
$ipAddress = if ($networkInfo) { $networkInfo.IPAddress -join ", " } else { "Não encontrado" }
Write-Host "`n=== Informações do Sistema ===" -ForegroundColor Cyan
Write-Host "Nome do Computador : $($systemInfo.Name)"
Write-Host "Usuário Atual : $userName"
Write-Host "Sistema Operacional: $($osInfo.Caption)"
Write-Host "Arquitetura : $($osInfo.OSArchitecture)"
Write-Host "Processador : $($cpuInfo.Name)"
Write-Host "Memória Total : $totalMemoryGB GB"
Write-Host "Endereço MAC : $macAddress"
Write-Host "Endereço IP : $ipAddress"