在查询中使用join时,为什么缺少某些系统属性? (powershell,get-wmiobject)

时间:2016-02-16 16:43:26

标签: powershell wmi sccm wql

我遇到了以下问题:

当我在运行查询时,里面有一个连接,那么系统属性“__PATH”为空。当我在没有加入的情况下运行它时,一切正常:

工作:

$apps = Get-WMIObject -Namespace root/SMS/site_$($siteCode) -ComputerName $($siteserver) -Query `
"SELECT * FROM SMS_Application where IsLatest='true' and IsExpired='false' and LocalizedDisplayName like '%hydro%'"

$apps[0].__PATH 

输出:“\ SCCM \ root \ SMS \ site_CMT:SMS_Application.CI_ID = 16781953”

不工作:

$apps = Get-WMIObject -Namespace root/SMS/site_$($siteCode) -ComputerName $($siteserver) -Query `
"SELECT * FROM SMS_Application as App join SMS_ObjectContainerItem as FI on App.ModelName=FI.InstanceKey where App.IsLatest='true' and IsExpired='false' and LocalizedDisplayName like '%hydro%'"

$apps[1].app.__PATH

我的问题: 任何人都可以向我解释为什么路径是空的? 非常感谢,问候

0 个答案:

没有答案
相关问题