$strComputer = “.”
$Excel = Nuevo-Objeto - COM Excel.Application
$Excel.visible = $True
$Excel = $Excel.Workbooks.Add ()
$Sheet = $Excel.WorkSheets.Item (1)
$Sheet.Cells.Item (1.1) = “computadora”
$Sheet.Cells.Item (1.2) = “letra de impulsión”
$Sheet.Cells.Item (1.3) = “descripción”
$Sheet.Cells.Item (1.4) = “sistema de ficheros”
$Sheet.Cells.Item (1.5) = “tamaño en el GB”
$Sheet.Cells.Item (1.6) = “espacio libre en el GB”
$WorkBook = $Sheet.UsedRange
$WorkBook.Interior.ColorIndex = 8
$WorkBook.Font.ColorIndex = 11
$WorkBook.Font.Bold = $True
$intRow = 2
$colItems = Consiguen-wmiObject - clasificar “Win32_LogicalDisk” - el `del namespace “raíz \ CIMV2”
- nombre de computadora $strComputer
foreach ($objItem en $colItems) {
$Sheet.Cells.Item ($intRow, 1) = $objItem.SystemName
$Sheet.Cells.Item ($intRow, 2) = $objItem.DeviceID
$Sheet.Cells.Item ($intRow, 3) = $objItem.Description
$Sheet.Cells.Item ($intRow, 4) = $objItem.FileSystem
$Sheet.Cells.Item ($intRow, 5) = $objItem.Size/1GB
$Sheet.Cells.Item ($intRow, 6) = $objItem.FreeSpace/1GB
$intRow = $intRow + 1
$WorkBook.EntireColumn.AutoFit ()
}
$intRow = $intRow + 1
$Sheet = $Excel.WorkSheets.Item (1)
$Sheet.Cells.Item ($introw, 1) = “producto”
$Sheet.Cells.Item ($introw, 2) = “vendedor”
$Sheet.Cells.Item ($introw, 3) = “versión”
$Sheet.Cells.Item ($introw, 4) = “instalan la fecha”
$introw = $introw + 1
$Keys = Consiguen-ChildItem HKLM: \ el software \ Microsoft \ Windows \ CurrentVersion \ desinstalan
$Items = $keys | foreach-objeto {Conseguir-ItemProperty $_.PsPath} | donde-objeto {($_.DisplayName - actualización del notmatch “|Ne $null de Hotfix”) - y ($_.DisplayName -)}
foreach ($item en $items) {
$Sheet.Cells.Item ($intRow, 1) = $Item.DisplayName
$Sheet.Cells.Item ($intRow, 2) = $Item.Publisher
$Sheet.Cells.Item ($intRow, 3) = $Item.DisplayVersion
$Sheet.Cells.Item ($intRow, 4) = $Item.InstallDate
$intRow = $intRow + 1
}
$WorkBook.EntireColumn.AutoFit ()
Claro
|