Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

OS caption equals: Why...does this not work?

$
0
0

I want to use GWMI to get OS and then branch accordingly.  Why does the following not work?

$gOS = gwmi win32_operatingsystem

$gOS.caption.equals("Microsoft Windows 7 Enterprise")

I get false as a result.  If I just do $gOS.caption it indeed does equal "Microsoft Windows 7 Enterprise".  In fact I copied the output of $gOS.caption to paste into the equals statement so I KNOW it is equal.


Viewing all articles
Browse latest Browse all 21975

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>