Skip to content

Instantly share code, notes, and snippets.

@poshcodebear
Created July 31, 2015 06:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save poshcodebear/90ca145f90386094a71b to your computer and use it in GitHub Desktop.
Save poshcodebear/90ca145f90386094a71b to your computer and use it in GitHub Desktop.
Test execution speed with Measure-Command
$computers = Get-ADComputer -SearchBase (Get-ADOrganizationalUnit -Filter {Name -eq 'Servers'} ) -Filter * | Select-Object -ExpandProperty Name
Measure-Command {
Get-WmiObject Win32_ComputerSystem -ComputerName $computers -ErrorAction ignore
}
Measure-Command {
Get-CimInstance Win32_ComputerSystem -ComputerName $computers -ErrorAction ignore
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment