You can do this:
((get-counter -counter '\\rmfvpc\TCPv4\Connections Established').countersamples) | % {$_.CookedValue}
and this:
(get-counter -counter '\\rmfvpc\TCPv4\Connections Established').Readings | findstr ^[0-9]
and this:
(get-counter -counter '\\rmfvpc\TCPv4\Connections Established' -continuous -sampleinterval 2)
but you can't do this:
Historic Blog. No longer active. A script repository that stopped at Powershell 4.0 is at www.rmfdevelopment.com/PowerShell_Scripts . My historic blog (no longer active) on Network Security ( http://thinking-about-network-security.blogspot.com ) is also Powershell heavy. AS of 2/27/2014 all Scripts are PS 4.0.
Wednesday, August 24, 2011
Monday, August 22, 2011
Some addendum on modules
If you add modules like PSUserTools from Microsoft you receive some enhanced functionality. You also receive some well conceived script. After you have imported your modules ('import-module'), you can use a function like that below to list all the exported commands:
function Global:get-module_exports {
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true)]
$ModName
)
$commands=(get-module $ModName).ExportedCommands
[Array[]]$list=(($commands).Values) | %{$_.Name} | Sort
$list
}
Labels:
Modules,
PSUserTools
Subscribe to:
Posts (Atom)