mirror of
https://github.com/Whitecat18/Mavoc
synced 2026-06-06 15:04:28 +00:00
38 lines
1.3 KiB
PowerShell
38 lines
1.3 KiB
PowerShell
<#
|
|
Scripts managed by https://github.com/Whitecat18
|
|
For More info . visit https://github.com/Whitecat18/Powershell-Scripts-for-Hackers-and-Pentesters
|
|
#>
|
|
|
|
function Get-PCInformation {
|
|
$pcInfo = @{
|
|
'ComputerName' = $env:COMPUTERNAME
|
|
'Manufacturer' = (Get-WmiObject Win32_ComputerSystem).Manufacturer
|
|
'Model' = (Get-WmiObject Win32_ComputerSystem).Model
|
|
'RAM' = '{0:N2} GB' -f ((Get-WmiObject Win32_ComputerSystem).TotalPhysicalMemory / 1GB)
|
|
'Processor' = (Get-WmiObject Win32_Processor).Name
|
|
'Storage' = (Get-WmiObject Win32_DiskDrive | Measure-Object Size -Sum).Sum / 1TB -as [int]
|
|
'WindowsVersion' = (Get-WmiObject Win32_OperatingSystem).Caption
|
|
}
|
|
|
|
return $pcInfo
|
|
}
|
|
|
|
$pcInformation = Get-PCInformation
|
|
|
|
$output = @"
|
|
Computer Information:
|
|
Computer Name: $($pcInformation['ComputerName'])
|
|
Manufacturer: $($pcInformation['Manufacturer'])
|
|
Model: $($pcInformation['Model'])
|
|
RAM: $($pcInformation['RAM'])
|
|
Processor: $($pcInformation['Processor'])
|
|
Storage: $($pcInformation['Storage']) TB
|
|
Windows Version: $($pcInformation['WindowsVersion'])
|
|
"@
|
|
|
|
$outputPath = Join-Path $env:TEMP "PC_Information.txt"
|
|
|
|
$output | Out-File -FilePath $outputPath
|
|
|
|
Write-Host "PC information has been saved to $outputPath"
|