how do i check a registry key value and make an action that if this value is less than a number its installing a program?
This topic has been locked.
Pinned topic check a registry key
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
SystemAdmin 110000D4XK2038 Posts
Re: check a registry key2012-11-20T15:51:44ZThis is the accepted answer. This is the accepted answer.As long as you know where the key is that should be straight forward:
//convert the value to a string and then a version
q: value "PowerShellVersion" of key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellEngine" of registry as string as version
T: 0.066 ms
I: singular version
//Once you have a version you can compare with <,>,=,!=
q: value "PowerShellVersion" of key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellEngine" of registry as string as version = "2.0"
T: 0.081 ms
I: singular boolean