Return variable properties


hi,

i can't figure out why variable properties $test.sharename , $test.servername return nothing ?

$test = get-wmiobject win32_dfstarget | where-object {$_.state -eq "1"}

write-host $test.sharename active on $test.servername

additionally, $test may array of objects.

try this:

$test = get-wmiobject win32_dfstarget | where-object {$_.state -eq "1"} $test | foreach-object {write-host $_.sharename active on $_.servername} 

karl


my blog: http://unlockpowershell.wordpress.com
book: windows powershell 2.0 bible
e-mail: -join ("6b61726c6d69747363686b65406d742e6e6574"-split"(?<=\g.{2})",19|%{[char][int]"0x$_"})


Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

CRL Revocation always failed

Failed to query the results of bpa xpath

0x300000d errors in Microsoft Remote Desktop client