Friday, July 6, 2018

PS Tool 1.2 - Get Windows Operating System,OS Architecture,OS Install Date ,Last BootUp Time,Total Uptime

Use below to get the following details using powershell from any computer

  • Windows Operating System
  • OS Architecture
  • OS Install Date 
  • Last BootUp Time
  • Total Uptime

$computers = "CM","DC","WIN7"
$os = Get-CimInstance Win32_operatingSystem -ComputerName $computers
$os | Select Caption,OSArchitecture,InstallDate,LastBootUpTime, `
@{Name="Uptime";Expression={(Get-Date)-$_.LastBootUpTime}},PSComputername


PS Tool 1.1 -Script to find the file size and count with file extensions

Use below script to find the file size and count with file extensions

Get-childitem c:\work -file -recurse | where extension | group extension | 
Select Name,Count,@{Name="Size";Expression={($_.group | measure length -sum).sum} }|
 Sort Size -Descending | format-table -AutoSize

Alias - Get-childitem / dir / ls







Featured Posts

Adding Accesspolicy to KeyVault for Service Principal Using Portal and Powershell

  Scripts path : https://drive.google.com/drive/folders/1sbBpnVFgXhUIXLdf2E9heyWDeU2f9427?usp=sharing  Adding Accesspolicy to KeyVault for S...