当我这样做,我得到的格式为"@{xxx}"...how,我只是得到计算机的描述和周围的其他任何格式吗?
$CompDes = Get-WmiObject -Class Win32_OperatingSystem =Select 写-主机“计算机描述$CompDes”
输出:
Computer Description @{Description=TESING_SERVER}谢谢,
发布于 2012-12-24 10:25:25
$CompDes = Get-WmiObject -Class Win32_OperatingSystem | Select -exp Description
Write-Host "Computer Description $CompDes"-exp是-ExpandProperty的缩写。它获取指定属性值。
发布于 2012-12-24 12:19:42
另一种方式是:
$CompDes = Get-WmiObject -Class Win32_OperatingSystem | Foreach-Object {$_.Description}https://stackoverflow.com/questions/14019662
复制相似问题