Last Patch Time and uptime fetching

I am using the following code to fetch the patch time and uptime for Linux and windows servers. the script runs fine for Linux but doesnt give any output for windows. Also please suggest if there is a way to trim the Linux result to get only the date and exclude the rest of the part.

if (name of operating system as lowercase contains "linux") then (line (number of lines of it) of file "/var/log/yum.log" ) else if (name of operating system as lowercase contains "win") then (maximum of (it as date) of ((preceding text of last "/" of following text of first "/" of it ) & " " & (preceding text of first "/" of it as integer as month as three letters)& " " & (following text of last "/" of it as integer as string)) of (string values of selects "InstalledOn from Win32_QuickFixEngineering" of wmi) whose (it as trimmed string != "")) else "no"