Set Variable if NUL...
 
Notifications
Clear all

Set Variable if NULL

3 Posts
2 Users
0 Reactions
39 Views
(@thinker)
Active Member Registered
Joined: 4 months ago
Posts: 7
Topic starter  

I need a little help here, maybe I'm making this complicated but essentially I want to display a tattooed WMI entry if it exists, if it doesn't exist, then a string of text that I've defined.  Otherwise, maybe PowerShell is the way to go?

The goal here is so that IT support can easily determine the device being SCCM built or AutoPilot

 

WMI=set:OSTSName,namespace:root\MYCOMPANY,query:MWP_OSD,display:%TaskSequenceName%,hidden:1
IF=value1:%OSTSName%,value2:null,comparator:eq
set OSTSName2=AutoPilot

TEXT=text:Build Type,display:{{{%OSTSName%}}}{{{%OSTSName2%}}},font-size:100%,color:ffffff

 


   
Quote
Nathan_K
(@nathan_k)
Estimable Member Registered
Joined: 4 years ago
Posts: 131
 

I don't think null is a valid value in DTI. It usually replaces a null return with a text value to avoid crashing. The null-result value under the [text] section can define what that should be. Then you'd just need something as simple as the following. You may need value2 to be blank, or matched up to the null-result value.

WMI=set:OSTSName,namespace:root\MYCOMPANY,query:MWP_OSD,display:%TaskSequenceName%,hidden:1
IF=value1:%OSTSName%,value2:,comparator:eq,true:AutoPilot,false:%OSTName%,set:BuildType=%1
TEXT=text:Build Type,display:%BuildType%,font-size:100%,color:ffffff

   
ReplyQuote
Nathan_K
(@nathan_k)
Estimable Member Registered
Joined: 4 years ago
Posts: 131
 

Also, just reviewing this, it should be "comp", not "comparator".


   
ReplyQuote
Glenn's Page