PowerShell - Get PC details log
create log with relevant machine configuration details
Script events
- Gather information on the computer system, CPU, OS and Hyper-V details
- Create a \Temp\Thinscale folder
- Create a .txt log file with all details exported
Script examples
Script
$NOW = Get-Date -Format dd-MM-yyyy--hh-mm #current time for the email details
$Dest = "C:\Temp\ThinScale"
$file = "$Dest\$env:computername-$NOW.txt"
$Processor = Get-WmiObject Win32_Processor
$PC = Get-WmiObject Win32_ComputerSystem | select PSComputerName, Manufacturer, Model, SystemType, HyperVisorPresent, NumberOfProcessors
$OS = Get-WmiObject win32_OperatingSystem | select Caption, BuildNumber, Version, OSArchitecture, PortableOperatingSystem, ServicePackMajorVersion
$Hyper = Get-WindowsFeature -Name Hyper-V | Select Name, Installed, InstallState
New-Item -Path $Dest -ItemType Directory -Force -Confirm:$false
$PC | Out-File $file
$Processor | Out-File $file -Append -Encoding unicode
$OS | Out-File $file -Append -Encoding unicode
$Hyper | fl | Out-File $file -Append -Encoding unicode