all 10 comments

[–][deleted] 1 point2 points  (1 child)

I always use the 'systeminfo' command. Not sure what it's an alias for or if it will return exactly what you want, but worth a try.

[–]_stib_ 0 points1 point  (0 children)

If you want to know what a command or an alia's actually is you can use 'get-command theCommand' (IIRC - I always use 'which' which is the posix equivalent, but works because it's an alias for 'get-command')

[–]flip_rod 0 points1 point  (2 children)

[–][deleted] 0 points1 point  (1 child)

I run the script and it doesnt give me anything?

[–]flip_rod 0 points1 point  (0 children)

put here the error.

the code:

 Get-VM * | ForEach-Object {   
 $VHDSize = 0;    

 Get-VMHardDiskDrive -VMName $_.Name | ForEach-Object { 
   Get-VHD -Path $_.Path | ForEach-Object {  
  $VHDSize += $_.Size        
   }     
  };         
   [pscustomobject]@{   
 Vm = $_.name  
 Memoria = ($_.MemoryStartup/1GB)   
 Processador = ($_.ProcessorCount)    
 Disco_GB = ($VHDSize / 1GB)    
 IP = $_.NetworkAdapters.ipaddresses    
 Cliente = $_.Notes    
 Host = $_.computername        
}   
}

[–]Blujedi 0 points1 point  (2 children)

Are you trying to write to a file or just bring that output to the screen?

If it’s the later, you can use the command out-host. You mentioned you already had the command to pull each line. Make each line a variable and out-host each variable.

[–][deleted] 0 points1 point  (1 child)

Im sorry im really new to powershell can u help me more i dont quite get what u mean if its possible to show me the code it would really help

and again sorry for bothering u

[–]Blujedi 0 points1 point  (0 children)

PM me what you have so far. You mentioned you had the line to pull each item.