//
stai leggendo...
domanda

Scripting Games–how not to output data

Richard Siddaway's Blog

I haven’t finished blogging about event 1 yet but this caught my eye.

Things aren’t too bad until we hit the bunch of  write-host calls

$wrks = (Get-Content -path C:\IPList.txt)
foreach ($wrk in $wrks)
{
    $osver = Get-WMIObject -class win32_operatingsystem -ComputerName $wrk
    $procs = @(Get-WMIObject -class win32_processor -ComputerName $wrk)
    $psok=($procs.SocketDesignation).count
    $pcors=(($procs.numberofcores[0])*$psok)
    $plog=($pcors * 2)
    $psped=$procs.MaxClockSpeed[0]
    $mem = Get-WMIObject -class win32_physicalmemory -ComputerName $wrk
    $memtotal = ($mem | Measure-Object -Property capacity -Sum)
    $memgb = $memtotal.sum/1gb
Write-host “*******************************************************”
Write-Host “Machine Name: ” $osver.CSName
Write-Host “OS: “$osver.caption
Write-Host “Service Pack: “$osver.csdversion
Write-Host “Build #: “$osver.version
Write-Host “*********** “
Write-Host “Memory Installed:”
Write-Host “*********** “
Write-Host “Memory (GB): $memgb “
Write-Host “Slots used:” $memtotal.Count
Write-Host “*********** “
Write-Host “Processor(s) Installed:”
Write-Host “*********** “
Write-Host “Sockets:” $psok
Write-Host “Cores:” $pcors
Write-Host “Logical Procs:” $plog
Write-Host “*********** “
Write-Host “Processor Details:”
Write-Host “*********** “
$procs
Write-Host “”
}

View original post 32 altre parole

Annunci

Discussione

Non c'è ancora nessun commento.

Rispondi

Inserisci i tuoi dati qui sotto o clicca su un'icona per effettuare l'accesso:

Logo WordPress.com

Stai commentando usando il tuo account WordPress.com. Chiudi sessione / Modifica )

Foto Twitter

Stai commentando usando il tuo account Twitter. Chiudi sessione / Modifica )

Foto di Facebook

Stai commentando usando il tuo account Facebook. Chiudi sessione / Modifica )

Google+ photo

Stai commentando usando il tuo account Google+. Chiudi sessione / Modifica )

Connessione a %s...

%d blogger hanno fatto clic su Mi Piace per questo: