Skip to content

Instantly share code, notes, and snippets.

@simstems
Last active July 7, 2025 18:56
Show Gist options
  • Save simstems/da947e028b8fb0a1f7a8d5449a1bc109 to your computer and use it in GitHub Desktop.
Save simstems/da947e028b8fb0a1f7a8d5449a1bc109 to your computer and use it in GitHub Desktop.

Revisions

  1. simstems renamed this gist Jul 7, 2025. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. simstems created this gist Jul 7, 2025.
    20 changes: 20 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    <#

    Invoke-Command -ComputerName REMOTEPC -ScriptBlock {
    Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object Name, Manufacturer, Model
    Get-CimInstance -ClassName Win32_BIOS | Select-Object -ExpandProperty SerialNumber
    }

    #>

    Invoke-Command -ComputerName REMOTEPC -ScriptBlock {
    $sys = Get-CimInstance -ClassName Win32_ComputerSystem
    $bios = Get-CimInstance -ClassName Win32_BIOS

    [PSCustomObject]@{
    Name = $sys.Name
    Manufacturer = $sys.Manufacturer
    Model = $sys.Model
    SerialNumber = $bios.SerialNumber
    }
    }