API Reference
RegFile
Represents a .reg file and allows policy manipulation.
Inheritance
- Object
- RegFile
Constructors
public RegFile() #Methods
public Void Apply(IPolicySource target) #VoidApplies the entire model to a target policy source.
Parameters
- target ADPlayground.Gpo.GpoLocal.IPolicySource
public Void ApplyDifference(PolFile oldVersion, PolFile newVersion) #VoidApplies the delta between this model and an optional previous version to a target policy source.
Parameters
- oldVersion ADPlayground.Gpo.GpoLocal.RegFile
- target ADPlayground.Gpo.GpoLocal.IPolicySource
ApplyDifference(ADPlayground.Gpo.GpoLocal.RegFile oldVersion, ADPlayground.Gpo.GpoLocal.PolFile target) #Applies the delta between this model and an optional previous version to a POL file.
Parameters
- oldVersion ADPlayground.Gpo.GpoLocal.RegFile
- target ADPlayground.Gpo.GpoLocal.PolFile
ApplyDifference(ADPlayground.Gpo.GpoLocal.PolFile oldVersion, ADPlayground.Gpo.GpoLocal.PolFile newVersion) #Applies the delta between a previous POL and this model into another POL file.
Parameters
- oldVersion ADPlayground.Gpo.GpoLocal.PolFile
- newVersion ADPlayground.Gpo.GpoLocal.PolFile
public Void ApplyFromPolFile(PolFile source) #VoidMerges settings from a POL file into this in-memory .reg model.
Parameters
- source ADPlayground.Gpo.GpoLocal.PolFile
public Void ApplyToPolFile(PolFile target) #VoidApplies the model to the specified POL file in place.
Parameters
- target ADPlayground.Gpo.GpoLocal.PolFile
public virtual Void ClearKey(String key) #VoidClears all values in a key by adding a **delvals marker.
Parameters
- key System.String
public virtual Boolean ContainsValue(String key, String value) #BooleanDetermines whether a value is present for a given key in the in-memory .reg model, accounting for pending delete operations.
Parameters
- key System.String
- Registry key path.
- value System.String
- Value name.
Returns
True when a value entry exists and is not scheduled for deletion.
public virtual Void DeleteValue(String key, String value) #VoidMarks a value for deletion by adding a **del.value entry.
Parameters
- key System.String
- value System.String
public IEnumerable<PolEntry> Enumerate() #IEnumerable<PolEntry>Enumerates POL entries representing the current .reg model, excluding delete markers.
public virtual Void ForgetKeyClearance(String key) #VoidRemoves any existing **delvals markers for the specified key.
Parameters
- key System.String
public virtual Void ForgetValue(String key, String value) #VoidRemoves a value entry from the model and clears any matching delete markers.
Parameters
- key System.String
- value System.String
public IReadOnlyList<String> GetKeyNames(String key) #IReadOnlyList<String>Returns direct subkey names under the specified key from the in-memory .reg model.
Parameters
- key System.String
- Registry key to enumerate.
Returns
List of subkey names.
public virtual IReadOnlyList<String> GetSubKeyNames(String key) #IReadOnlyList<String>Gets subkey names under the specified key by inspecting in-memory entries.
Parameters
- key System.String
public virtual Object GetValue(String key, String value) #ObjectRetrieves the value data for a given key/value pair.
Parameters
- key System.String
- Registry key path.
- value System.String
- Value name.
Returns
Typed value data, or null when not present.
public RegistryValueKind GetValueKind(String key, String value) #RegistryValueKindGets the value kind for a given key/value pair.
Parameters
- key System.String
- Registry key path.
- value System.String
- Value name.
Returns
Kind of the value as represented in the .reg file.
public virtual IReadOnlyList<String> GetValueNames(String key) #IReadOnlyList<String>Returns value names under the specified key from the in-memory .reg model.
Parameters
- key System.String
- Registry key path (e.g., HKLM\\Software\\...)
Returns
List of value names; does not include delete markers (**).
public static RegFile Load(String file) #RegFileLoads a .reg file into a RegFile instance.
Parameters
- file System.String
- Path to a .reg file.
Returns
Parsed RegFile.
public Void Save(String file) #VoidSaves the in-memory .reg model to disk.
Parameters
- file System.String
- Destination file path.
public virtual Void SetValue(String key, String value, Object data, RegistryValueKind dataType) #VoidSets or replaces a value in the model.
Parameters
- key System.String
- Registry key path.
- value System.String
- Value name.
- data System.Object
- Value data.
- dataType Microsoft.Win32.RegistryValueKind
- Registry value kind.
public virtual Boolean WillDeleteValue(String key, String value) #BooleanIndicates whether a given key/value pair has a pending delete marker (e.g., **del.value or **delvals).
Parameters
- key System.String
- Registry key path.
- value System.String
- Value name.
Returns
True if a delete marker exists that would remove the value.