This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-Uptime { | |
param ($snames = 'localhost') | |
$global:objects = @() | |
foreach ($sname in $snames) { | |
$object = New-Object –TypeName PSObject | |
$object | Add-Member –Type NoteProperty –Name Name –Value $sname | |
Try { | |
Test-Connection $sname -ErrorAction Stop | Out-Null | |
Try { | |
($osinfo = Get-CimInstance -ClassName win32_operatingsystem -ComputerName $sname -ErrorAction Stop) > $null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$list = @" | |
1 Partridge in a pear tree | |
2 Turtle Doves | |
3 French Hens | |
4 Calling Birds | |
5 Golden Rings | |
6 Geese a laying | |
7 Swans a swimming | |
8 Maids a milking | |
9 Ladies dancing |