title: How to combine output from Get-CimInstance and Get-WMIObject functions
body: <p>I have got 2 powershell scripts, which I have mentioned below. I am looking for a way to combine both of these scripts. However I am unable to do so as one of the script is using CIM method and the other one is using the WMI method.</p>
  
  <p>What I am trying to accomplish, is to provide the last reboot time and free space available of the same server (User has to enter the server name and on pressing <code>Enter</code> it shows the last reboot time and free space available).</p>
  
  <p>Script 1 (CIM Method) :</p>
  
  <pre><code>$Server = Read-Host -Prompt 'Input your server  name'
  Get-CimInstance -ClassName win32_operatingsystem -ComputerName $Server | select csname, lastbootuptime
  Read-Host -Prompt "Press Enter to exit"
  </code></pre>
  
  <p>Script 2 (WMI Method) :</p>
  
  <pre><code>$Server = Read-Host -Prompt 'Input your server  name'
  Get-WMIObject Win32_Logicaldisk -ComputerName $Server | Select PSComputername,DeviceID, @{Name="Total_Size_GB";Expression={$_.Size/1GB -as [int]}}, @{Name="Free_Space_GB";Expression={[math]::Round($_.Freespace/1GB,2)}}
  Read-Host -Prompt "Press Enter to exit"
  </code></pre>