The queries are written to list the WUA history in a PowerShell by defining a few functions to convert WUA history events of result code to a Name and get the last and latest 50 WUA history.