问题描述
大家好,
      我正在使用power-shell获取特定产品的列表。如果我没有收到任何信息列表,我想显示信息,因为"此产品不存在任何信息"。
I am getting list of particular product using power-shell.I want to display the info if i didn't get any list of info as "No information exist with this product".
    我收到了power-shell中的代码片段,以便找到我想知道天气的办公产品"$ Mylist"。是没有.if null 我想显示消息。任何人都可以帮我解决这个问题
I had received snippet of code in power-shell to find office product I want to know weather "$Mylist" is null of not .if null I would like to show message.Can any one help me how can I do this
$ Mylist = gwmi Win32_Product |?{$ _。名称-match'office'} |选择名称
$Mylist= gwmi Win32_Product |?{$_.Name -match 'office'}|select name
谢谢,质量沟通提供高质量的工作。 http://siddiq-sharepoint2010.blogspot.in/ Siddiqali Mohammad。
Thanks, Quality Communication Provides Quality Work. http://siddiq-sharepoint2010.blogspot.in/ Siddiqali Mohammad .
推荐答案
尝试一下:
这篇关于在Power-shell中使用If条件为空显示消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!