Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

Reply To: Format from a Variable

$
0
0

Just FYI, here is my final sample script, and works like a charm. Thanks again Don for the proper push.

$strComputers = "Computer1", "Computer2"
Foreach ($strcomputer in $strComputers)
{
    If (!(Test-Connection -ComputerName $strComputer -Count 1 -Quiet))
    {
        $whatever = "Not Online"
        $properties = @{'ComputerName'=$strComputer; 'Status'=$whatever}
        New-Object -Type PSObject -Prop $properties
    }
}

Viewing all articles
Browse latest Browse all 13067

Trending Articles