Trigger the Creation of a Specific Preference List? I have the following function: 

hardware_model () {

  local hardware_mod
  hardware_mod=$(defaults read ~/Library/Preferences/com.apple.SystemProfiler.plist 'CPU Names' \
  | cut -sd '"' -f 4 \
  | uniq)

  write_header "Hardware Model" "$hardware_mod"
}


which returns, e.g.: MacBook Air (13-inch, Early 2014). 

However, on some machines--running the same OS X version--I get: 

2018-08-20 11:59:30.331 defaults[25029:3478859] 
The domain/default pair of 
(/var/root/Library/Preferences/com.apple.SystemProfiler.plist, CPU 
Names) does not exist . 


My question is: what specific action(s) trigger the creation of: com.apple.SystemProfiler.plist? I'd like to be able to create this file reliably in OS X 10.10-10.13 (inclusive), from a terminal, if possible.  

Thanks.
In case you're still trying to do this, I just figured out how to generate the file on my Mac running Mac OS X 10.13.6 (17G65).

It's remarkably simple. The file seems to be generated once you select “About This Mac” from the  menu, as shown here:



Before that, "$HOME/Library/Preferences/com.apple.SystemProfiler.plist" did not exist.

After that, I could run

defaults read "$HOME/Library/Preferences/com.apple.SystemProfiler.plist" 'CPU Names'

and get the result I was looking for.