Class: Specinfra::Command::Windows::Base::RegistryKey
- Inherits:
-
Specinfra::Command::Windows::Base
- Object
- Specinfra::Command::Windows::Base
- Specinfra::Command::Windows::Base::RegistryKey
- Defined in:
- lib/specinfra/command/windows/base/registry_key.rb
Constant Summary collapse
- REGISTRY_KEY_TYPES =
{ :type_string => 'String', :type_binary => 'Binary', :type_dword => 'DWord', :type_qword => 'QWord', :type_multistring => 'MultiString', :type_expandstring => 'ExpandString' }
Class Method Summary collapse
- .check_exists(key_name) ⇒ Object
- .check_has_property(key_name, key_property) ⇒ Object
- .check_has_value(key_name, key_property) ⇒ Object
Methods inherited from Specinfra::Command::Windows::Base
Class Method Details
.check_exists(key_name) ⇒ Object
12 13 14 15 |
# File 'lib/specinfra/command/windows/base/registry_key.rb', line 12 def check_exists(key_name) cmd = "(Get-Item 'Registry::#{key_name}') -ne $null" create_command cmd end |
.check_has_property(key_name, key_property) ⇒ Object
17 18 19 20 |
# File 'lib/specinfra/command/windows/base/registry_key.rb', line 17 def check_has_property(key_name, key_property) cmd = "(Get-Item 'Registry::#{key_name}').GetValueKind('#{key_property[:name]}') -eq '#{get_key_type(key_property[:type])}'" create_command cmd end |
.check_has_value(key_name, key_property) ⇒ Object
22 23 24 25 26 |
# File 'lib/specinfra/command/windows/base/registry_key.rb', line 22 def check_has_value(key_name, key_property) value = convert_key_property_value key_property cmd = "(Compare-Object (Get-Item 'Registry::#{key_name}').GetValue('#{key_property[:name]}') #{value}) -eq $null" create_command cmd end |