Skip to content

Instantly share code, notes, and snippets.

@jkavanagh58
Created March 16, 2017 15:49
Show Gist options
  • Save jkavanagh58/7d7e56d6034bec74e044bf785adb24c9 to your computer and use it in GitHub Desktop.
Save jkavanagh58/7d7e56d6034bec74e044bf785adb24c9 to your computer and use it in GitHub Desktop.
# Example of an inline filter and then a calculated expression
get-adcomputer -Filter {OperatingSystem -like "*Server*" -AND Name -like "PIT*"} |
Select-Object Name,@{n="online";e={test-connection -Computer $_.Name -Count 1 -Quiet}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment