Module: WinUtilinfo::OperatingSystemMethods
- Included in:
- WinUtilinfo
- Defined in:
- lib/win_utilinfo/operating_system_methods.rb
Instance Method Summary collapse
- #get_build_number ⇒ Object
- #get_original_install_date ⇒ Object
- #get_os_architecture ⇒ Object
- #get_os_name ⇒ Object
- #is_licenced ⇒ Object
Instance Method Details
#get_build_number ⇒ Object
9 10 11 12 13 |
# File 'lib/win_utilinfo/operating_system_methods.rb', line 9 def get_build_number build_number = `wmic os get BuildNumber | more +1` build_number.strip! return build_number end |
#get_original_install_date ⇒ Object
15 16 17 18 19 |
# File 'lib/win_utilinfo/operating_system_methods.rb', line 15 def get_original_install_date install_date = `powershell -c "gcim Win32_OperatingSystem | select InstallDate -ExpandProperty InstallDate"` install_date.strip! return install_date end |
#get_os_architecture ⇒ Object
21 22 23 24 25 |
# File 'lib/win_utilinfo/operating_system_methods.rb', line 21 def get_os_architecture os_architecture = `wmic os get OSArchitecture | more +1` os_architecture.strip! return os_architecture end |
#get_os_name ⇒ Object
3 4 5 6 7 |
# File 'lib/win_utilinfo/operating_system_methods.rb', line 3 def get_os_name os_name = `wmic os get caption | more +1` os_name.strip! return os_name end |
#is_licenced ⇒ Object
27 28 29 30 |
# File 'lib/win_utilinfo/operating_system_methods.rb', line 27 def is_licenced licence_status = `wmic PATH SoftwareLicensingProduct WHERE "ProductKeyID like '%-%' AND Description like '%Windows%'" get LicenseStatus | more +1` return licence_status end |