Advertisement
Guest User

Untitled

a guest
May 24th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.03 KB | None | 0 0
  1. # Информация о ПК
  2. Write-Output User
  3. $PCName = @{
  4. Name = "Computer name"
  5. Expression={$_.Name}
  6. }
  7. $Domain = @{
  8. Name = "Domain"
  9. Expression={$_.Domain}
  10. }
  11. $UserName = @{
  12. Name = "User Name"
  13. Expression={$_.PrimaryOwnerName}
  14. }
  15. (Get-CimInstance –ClassName CIM_ComputerSystem | Select-Object $PCName, $Domain, $UserName | Format-Table | Out-String).Trim()
  16. Write-Output ""
  17. Write-Host "Operating System"
  18. $OS = @{
  19. Name = "Name"
  20. Expression={$_.Caption}
  21. }
  22. $InstallDate = @{
  23. Name = "Install Date"
  24. Expression={$_.InstallDate}
  25. }
  26. $Version = @{
  27. Name = "Version"
  28. Expression = {$_.Version}
  29. }
  30. $Arch = @{
  31. Name = "Architecture"
  32. Expression = {$_.OSArchitecture}
  33. }
  34. (Get-CimInstance -ClassName CIM_OperatingSystem | Select-Object $OS, $InstallDate, $Version, $Arch | Format-Table | Out-String).Trim()
  35. Write-Output ""
  36. Write-Output BIOS
  37. $Version = @{
  38. Name = "Version"
  39. Expression = {$_.Name}
  40. }
  41. (Get-CimInstance -ClassName CIM_BIOSElement | Select-Object Manufacturer, $Version | Format-Table | Out-String).Trim()
  42. Write-Output ""
  43. Write-Output Motherboard
  44. (Get-CimInstance -ClassName Win32_BaseBoard | Select-Object Manufacturer, Product | Format-Table | Out-String).Trim()
  45. Write-Output ""
  46. Write-Output CPU
  47. $Cores = @{
  48. Name = "Cores"
  49. Expression = {$_.NumberOfCores}
  50. }
  51. $L3CacheSize = @{
  52. Name = "L3, MB"
  53. Expression = {$_.L3CacheSize / 1024}
  54. }
  55. $Threads = @{
  56. Name = "Threads"
  57. Expression = {$_.NumberOfLogicalProcessors}
  58. }
  59. (Get-CimInstance -ClassName CIM_Processor | Select-Object Name, $Cores, $L3CacheSize, $Threads | Format-Table | Out-String).Trim()
  60. Write-Output ""
  61. Write-Output RAM
  62. $Speed = @{
  63. Name = "Speed, MHz"
  64. Expression = {$_.Configuredclockspeed}
  65. }
  66. $Capacity = @{
  67. Name = "Capacity, GB"
  68. Expression = {$_.Capacity / 1GB}
  69. }
  70. (Get-CimInstance -ClassName CIM_PhysicalMemory | Select-Object Manufacturer, PartNumber, $Speed, $Capacity | Format-Table | Out-String).Trim()
  71. Write-Output ""
  72. Write-Output "Physical disks"
  73. $Model = @{
  74. Name = "Model"
  75. Expression = {$_.FriendlyName}
  76. }
  77. $MediaType = @{
  78. Name = "Drive type"
  79. Expression = {$_.MediaType}
  80. }
  81. $Size = @{
  82. Name = "Size, GB"
  83. Expression = {[math]::round($_.Size / 1GB, 2)}
  84. }
  85. $BusType = @{
  86. Name = "Bus type"
  87. Expression = {$_.BusType}
  88. }
  89. (Get-PhysicalDisk | Select-Object $Model, $MediaType, $BusType, $Size | Format-Table | Out-String).Trim()
  90. Write-Output ""
  91. Write-Output "Logical disks"
  92. Enum DriveType {
  93. RemovableDrive = 2
  94. HardDrive = 3
  95. NetworkDrive = 4
  96. }
  97. $Name = @{
  98. Name = "Name"
  99. Expression = {$_.DeviceID}
  100. }
  101. $Type = @{
  102. Name = "Drive Type"
  103. Expression = {[enum]::GetName([DriveType],$_.DriveType)}
  104. }
  105. $Path = @{
  106. Name = "Path"
  107. Expression = {$_.ProviderName}
  108. }
  109. $Size = @{
  110. Name = "Size, GB"
  111. Expression = {[math]::round($_.Size/1GB, 2)}
  112. }
  113. (Get-CimInstance -ClassName CIM_LogicalDisk | Where-Object -FilterScript {$_.DriveType} | Select-Object $Name, $Type, $Path, VolumeName, $Size | Format-Table | Out-String).Trim()
  114. Write-Output ""
  115. Write-Output "Video сontrollers"
  116. (Get-CimInstance -ClassName CIM_VideoController).Caption
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement