|
| 1 | +TOPIC |
| 2 | + about_Config |
| 3 | + |
| 4 | +SHORT DESCRIPTION |
| 5 | + Provides details about the configuration management functions in the PowerShell Module. |
| 6 | + |
| 7 | +LONG DESCRIPTION |
| 8 | + The PowerShell Module provides a set of functions to manage the configuration related to the module. |
| 9 | + This configuration is stored in a custom secret vault and can be accessed, modified, saved, and restored |
| 10 | + using the provided cmdlets. |
| 11 | + |
| 12 | + Name: SecretVault |
| 13 | + Path: \classes\Data\SecretVault.ps1 |
| 14 | + |
| 15 | + | Name | Type | Default Value | Description | |
| 16 | + | --------------- | -------------- | ---------------------------------- | ----------------------------- | |
| 17 | + | SecretVault | pscustomobject | {Name, Type} | | |
| 18 | + | SecretVault.Name | string | 'GitHub' | The name of the secret vault. | |
| 19 | + | SecretVault.Type | string | 'Microsoft.PowerShell.SecretStore' | The type of the secret vault. | |
| 20 | + | Secret | pscustomobject | {Name} | | |
| 21 | + | Secret.Name | string | 'Config' | The name of the secret. | |
| 22 | + |
| 23 | + |
| 24 | + Name: Config |
| 25 | + Path: \classes\Data\Config.ps1 |
| 26 | + |
| 27 | + | Name | Type | Static Value | Description | |
| 28 | + | --------------- | ----------------- | ------------------------ | ------------------------ | |
| 29 | + | App | pscustomobject | {API, Defaults} | | |
| 30 | + | App.API | pscustomobject | {BaseURI, Version} | | |
| 31 | + | App.API.BaseURI | string | 'https://api.github.com' | The GitHub API Base URI. | |
| 32 | + | App.API.Version | string | '2022-11-28' | The GitHub API version. | |
| 33 | + | App.Defaults | pscustomobject | {} | | |
| 34 | + |
| 35 | + Functions provided in the module: |
| 36 | + |
| 37 | + - Get-GitHubConfig: Fetches the current module configuration. |
| 38 | + - Reset-GitHubConfig: Resets all or specific sections to its default values. |
| 39 | + - Restore-GitHubConfig: Restores the configuration from the secret vault. |
| 40 | + - Save-GitHubConfig: Saves the current configuration to the secret vault. |
| 41 | + - Set-GitHubConfig: Allows setting specific elements of the configuration. |
| 42 | + |
| 43 | + The configuration values are securely stored using the SecretManagement and SecretStore modules. |
| 44 | + During the module import, the following steps are performed: |
| 45 | + - Initialize the configuration store. |
| 46 | + - Check for secret vault of type 'Microsoft.PowerShell.SecretStore'. |
| 47 | + If not registered for the current user, its configuration will be reset to unattended mode. |
| 48 | + - Check for secret vault with the name 'GitHub'. |
| 49 | + If it does not exist, it will be created with current configuration. |
| 50 | + If the user is already using the secret vault, the existing configuration will be kept. |
| 51 | + - Restore saved configuration from the configuration store. |
| 52 | + - Look for the 'GitHub' secret vault. |
| 53 | + - Look for the secret called 'Config'. If it exists, restore the configuration from it into memory |
| 54 | + |
| 55 | +EXAMPLES |
| 56 | + |
| 57 | + -------------------------- EXAMPLE 1 -------------------------- |
| 58 | + |
| 59 | + Get-GitHubConfig |
| 60 | + |
| 61 | + This command retrieves the current GitHub configuration. |
| 62 | + |
| 63 | + -------------------------- EXAMPLE 2 -------------------------- |
| 64 | + |
| 65 | + Set-GitHubConfig -APIBaseURI 'https://api.newurl.com' -APIVersion '2023-09-23' |
| 66 | + |
| 67 | + This command sets the API Base URI to 'https://api.newurl.com' and the API version to '2023-09-23'. |
| 68 | + |
| 69 | + -------------------------- EXAMPLE 3 -------------------------- |
| 70 | + |
| 71 | + Restore-GitHubConfig |
| 72 | + |
| 73 | + This command restores the GitHub configuration from the secret vault. |
| 74 | + |
| 75 | + -------------------------- EXAMPLE 4 -------------------------- |
| 76 | + |
| 77 | + Reset-GitHubConfig -Scope 'App.API' |
| 78 | + |
| 79 | + This command resets the 'App.API' section of the GitHub configuration to its default values. |
| 80 | + |
| 81 | + -------------------------- EXAMPLE 5 -------------------------- |
| 82 | + |
| 83 | + Save-GitHubConfig |
| 84 | + |
| 85 | + This command saves the current GitHub configuration to the secret vault. |
| 86 | + |
| 87 | +KEYWORDS |
| 88 | + GitHub |
| 89 | + PowerShell |
| 90 | + SecretManagement |
| 91 | + SecretStore |
| 92 | + |
| 93 | +SEE ALSO |
| 94 | + - For more information about SecretManagement and SecretStore: |
| 95 | + https://learn.microsoft.com/en-us/powershell/utility-modules/secretmanagement/overview?view=ps-modules |
| 96 | + - The GitHub repository of this module: |
| 97 | + https://github.com/PSModule/GitHub |
| 98 | + - PowerShell Gallery page for SecretManagement module: |
| 99 | + https://www.powershellgallery.com/packages/Microsoft.PowerShell.SecretManagement/ |
0 commit comments