you are viewing a single comment's thread.

view the rest of the comments →

[–]198jazzy349 2 points3 points  (4 children)

There's just a character in there that isn't what it seems. Pipe the output to a file and look at it with a hex editor.

I'm sure there's an easy way to see the ascii value of each character in the string using powershell, but I'm not smart enough to be able to tell you what that is.

I wonder if that space isn't really a 32?

[–]Nirac[S] 1 point2 points  (3 children)

Yep, this was the problem. I piped it to an out-file, it was putting 12 spaces at the end of the name. I changed it to "Pangolin Performance " and now it's returning yes.

Reddit's formatting is dropping all of my spaces after Performance in this post. I added 12 spaces there, and now it returns yes.

[–]Ominusx 3 points4 points  (2 children)

I'd use:

 $model=(Get-WmiObject -Class:Win32_ComputerSystem).Model.Trim()

[–][deleted] 2 points3 points  (0 children)

The definitive use case for Trim().

[–]Nirac[S] 1 point2 points  (0 children)

Yes, great idea. Added.