Skip to content

Instantly share code, notes, and snippets.

@mczerniawski
Created December 18, 2018 15:22
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 mczerniawski/1c857021924bfd604ce847ecf5f89de7 to your computer and use it in GitHub Desktop.
Save mczerniawski/1c857021924bfd604ce847ecf5f89de7 to your computer and use it in GitHub Desktop.
foreach ($server in $ServerList) {
#Generate all variables
$resultCounters = Invoke-Command -ComputerName $server -Credential $Credential -ScriptBlock {
param(
$MetricList
)
Get-Counter -Counter $MetricList -SampleInterval 10 -MaxSamples 10
} -ArgumentList $MetricList
$resultCounters | Export-Counter -Path $path -FileFormat $fileFormat
#...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment