diff --git a/.github/actions/spelling/expect/generic_terms.txt b/.github/actions/spelling/expect/generic_terms.txt index 7f77f979..9cc94fa6 100644 --- a/.github/actions/spelling/expect/generic_terms.txt +++ b/.github/actions/spelling/expect/generic_terms.txt @@ -1,3 +1,4 @@ +adaptedresource ADDLOCAL Amd Authenticode @@ -9,6 +10,7 @@ liveserver ltsc onebranch screenshots +scrollbars Scrollbars Searchbox Sdl diff --git a/.github/actions/spelling/expect/software.txt b/.github/actions/spelling/expect/software.txt index d0acea99..6eac7d03 100644 --- a/.github/actions/spelling/expect/software.txt +++ b/.github/actions/spelling/expect/software.txt @@ -2,6 +2,9 @@ vscode Linux dotnet dotnettool +microsoftdotnet +microsoftvscode +pythonpip NUnit reportgenerator markdownlint diff --git a/.github/actions/spelling/expect/usernames.txt b/.github/actions/spelling/expect/usernames.txt index 9fe50450..a0a5a7ce 100644 --- a/.github/actions/spelling/expect/usernames.txt +++ b/.github/actions/spelling/expect/usernames.txt @@ -1,4 +1,6 @@ +demitrius denelon Dobbeleer +nelon ryanlua victorfrye diff --git a/.github/actions/spelling/expect/windows_terms.txt b/.github/actions/spelling/expect/windows_terms.txt index 30e73bda..94e05c0e 100644 --- a/.github/actions/spelling/expect/windows_terms.txt +++ b/.github/actions/spelling/expect/windows_terms.txt @@ -1,3 +1,8 @@ +microsoftwindowsdeveloper +microsoftwindowssandbox +microsoftwindowssettingaccessibility +microsoftwindowssettings +sideloading stickykeys filterkeys togglekeys diff --git a/resources/GitDsc/GitDsc.psm1 b/resources/GitDsc/GitDsc.psm1 index 04aecc84..59c2c962 100644 --- a/resources/GitDsc/GitDsc.psm1 +++ b/resources/GitDsc/GitDsc.psm1 @@ -17,6 +17,46 @@ enum ConfigLocation { } #region DSCResources +<# + .SYNOPSIS + The `GitClone` DSC resource is used to clone a Git repository to a local directory. + + .DESCRIPTION + The `GitClone` DSC resource clones a remote Git repository specified by its HTTPS URL + into a local root directory. If the repository has already been cloned, the resource + will confirm the existing remote matches the specified URL. + + ## Requirements + + * Target machine must have Git installed. + + .PARAMETER HttpsUrl + The HTTPS URL of the Git repository to clone. This is a key property. + + .PARAMETER Ensure + Specifies whether the repository should be present or absent. Defaults to `Present`. + Removing a cloned repository is not supported by this resource. + + .PARAMETER RemoteName + The name of the remote. Defaults to `origin`. + + .PARAMETER RootDirectory + The root directory where the repository will be cloned into. This is a mandatory property. + + .PARAMETER FolderName + The folder name for the cloned repository. If not specified, it is derived from the HTTPS URL. + + .PARAMETER ExtraArgs + Additional arguments to pass to `git clone`. + + .EXAMPLE + Invoke-DscResource -ModuleName GitDsc -Name GitClone -Method Set -Property @{ + HttpsUrl = 'https://github.com/microsoft/winget-dsc' + RootDirectory = 'C:\repos' + } + + This example clones the winget-dsc repository into C:\repos. +#> [DSCResource()] class GitClone { [DscProperty()] @@ -90,7 +130,7 @@ class GitClone { } Set-Location $this.RootDirectory - + if ($this.FolderName) { $cloneArgs = "$($this.HttpsUrl) $($this.FolderName)" } else { @@ -100,11 +140,45 @@ class GitClone { if ($this.ExtraArgs) { $cloneArgs = "$($this.ExtraArgs) $cloneArgs" } - + Invoke-GitClone($cloneArgs) } } +<# + .SYNOPSIS + The `GitRemote` DSC resource is used to manage remote repository references in a Git project. + + .DESCRIPTION + The `GitRemote` DSC resource adds or removes a named remote URL from an existing local + Git repository. The project directory must already exist as a valid Git repository. + + ## Requirements + + * Target machine must have Git installed. + * The project directory must be an existing Git repository. + + .PARAMETER RemoteName + The name of the Git remote. This is a key property. + + .PARAMETER RemoteUrl + The URL of the Git remote. This is a key property. + + .PARAMETER Ensure + Specifies whether the remote should be present or absent. Defaults to `Present`. + + .PARAMETER ProjectDirectory + The path to the local Git repository. This is a mandatory property. + + .EXAMPLE + Invoke-DscResource -ModuleName GitDsc -Name GitRemote -Method Set -Property @{ + RemoteName = 'upstream' + RemoteUrl = 'https://github.com/microsoft/winget-dsc' + ProjectDirectory = 'C:\repos\winget-dsc' + } + + This example adds an upstream remote to the specified local Git repository. +#> [DSCResource()] class GitRemote { [DscProperty()] @@ -165,6 +239,39 @@ class GitRemote { } } +<# + .SYNOPSIS + The `GitConfigUserName` DSC resource is used to manage the Git user name configuration. + + .DESCRIPTION + The `GitConfigUserName` DSC resource sets or removes the `user.name` Git configuration + value at the specified configuration scope (local, global, system, or worktree). + + ## Requirements + + * Target machine must have Git installed. + * For system-level configuration, the resource must be run as an Administrator. + + .PARAMETER UserName + The Git user name to configure. This is a key property. + + .PARAMETER Ensure + Specifies whether the user name should be present or absent. Defaults to `Present`. + + .PARAMETER ConfigLocation + The Git configuration scope to apply the setting to (e.g., `global`, `system`, `local`). + + .PARAMETER ProjectDirectory + The path to the Git repository. Required for non-global and non-system configurations. + + .EXAMPLE + Invoke-DscResource -ModuleName GitDsc -Name GitConfigUserName -Method Set -Property @{ + UserName = 'Demitrius Nelon' + ConfigLocation = 'global' + } + + This example sets the global Git user name to 'Demitrius Nelon'. +#> [DSCResource()] class GitConfigUserName { [DscProperty()] @@ -228,6 +335,39 @@ class GitConfigUserName { } } +<# + .SYNOPSIS + The `GitConfigUserEmail` DSC resource is used to manage the Git user email configuration. + + .DESCRIPTION + The `GitConfigUserEmail` DSC resource sets or removes the `user.email` Git configuration + value at the specified configuration scope (local, global, system, or worktree). + + ## Requirements + + * Target machine must have Git installed. + * For system-level configuration, the resource must be run as an Administrator. + + .PARAMETER UserEmail + The Git user email to configure. This is a key property. + + .PARAMETER Ensure + Specifies whether the user email should be present or absent. Defaults to `Present`. + + .PARAMETER ConfigLocation + The Git configuration scope to apply the setting to (e.g., `global`, `system`, `local`). + + .PARAMETER ProjectDirectory + The path to the Git repository. Required for non-global and non-system configurations. + + .EXAMPLE + Invoke-DscResource -ModuleName GitDsc -Name GitConfigUserEmail -Method Set -Property @{ + UserEmail = 'demitrius.nelon@example.com' + ConfigLocation = 'global' + } + + This example sets the global Git user email to 'demitrius.nelon@example.com'. +#> [DSCResource()] class GitConfigUserEmail { [DscProperty()] diff --git a/resources/GitDsc/gitdsc.dsc.manifests.json b/resources/GitDsc/gitdsc.dsc.manifests.json new file mode 100644 index 00000000..a601bf24 --- /dev/null +++ b/resources/GitDsc/gitdsc.dsc.manifests.json @@ -0,0 +1,192 @@ +{ + "adaptedResources": [ + { + "requireAdapter": "Microsoft.Adapter/PowerShell", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/adaptedresource/manifest.json", + "kind": "resource", + "version": "0.1.0", + "type": "GitDsc/GitClone", + "author": "DscSamples", + "description": "The `GitClone` DSC resource is used to clone a Git repository to a local directory.", + "capabilities": ["get", "test", "set"], + "schema": { + "embedded": { + "type": "object", + "required": ["HttpsUrl", "RootDirectory"], + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "Ensure": { + "type": "string", + "enum": ["Absent", "Present"], + "title": "Ensure", + "description": "Specifies whether the repository should be present or absent. Defaults to `Present`.\r\n Removing a cloned repository is not supported by this resource." + }, + "HttpsUrl": { + "type": "string", + "title": "HttpsUrl", + "description": "The HTTPS URL of the Git repository to clone. This is a key property." + }, + "RemoteName": { + "type": "string", + "title": "RemoteName", + "description": "The name of the remote. Defaults to `origin`." + }, + "RootDirectory": { + "type": "string", + "title": "RootDirectory", + "description": "The root directory where the repository will be cloned into. This is a mandatory property." + }, + "FolderName": { + "type": "string", + "title": "FolderName", + "description": "The folder name for the cloned repository. If not specified, it is derived from the HTTPS URL." + }, + "ExtraArgs": { + "type": "string", + "title": "ExtraArgs", + "description": "Additional arguments to pass to `git clone`." + } + }, + "description": "The `GitClone` DSC resource is used to clone a Git repository to a local directory.", + "title": "GitDsc/GitClone" + } + }, + "path": "GitDsc.psd1" + }, + { + "requireAdapter": "Microsoft.Adapter/PowerShell", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/adaptedresource/manifest.json", + "kind": "resource", + "version": "0.1.0", + "type": "GitDsc/GitRemote", + "author": "DscSamples", + "description": "The `GitRemote` DSC resource is used to manage remote repository references in a Git project.", + "capabilities": ["get", "test", "set"], + "schema": { + "embedded": { + "type": "object", + "required": ["RemoteName", "RemoteUrl", "ProjectDirectory"], + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "Ensure": { + "type": "string", + "enum": ["Absent", "Present"], + "title": "Ensure", + "description": "Specifies whether the remote should be present or absent. Defaults to `Present`." + }, + "RemoteName": { + "type": "string", + "title": "RemoteName", + "description": "The name of the Git remote. This is a key property." + }, + "RemoteUrl": { + "type": "string", + "title": "RemoteUrl", + "description": "The URL of the Git remote. This is a key property." + }, + "ProjectDirectory": { + "type": "string", + "title": "ProjectDirectory", + "description": "The path to the local Git repository. This is a mandatory property." + } + }, + "description": "The `GitRemote` DSC resource is used to manage remote repository references in a Git project.", + "title": "GitDsc/GitRemote" + } + }, + "path": "GitDsc.psd1" + }, + { + "requireAdapter": "Microsoft.Adapter/PowerShell", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/adaptedresource/manifest.json", + "kind": "resource", + "version": "0.1.0", + "type": "GitDsc/GitConfigUserName", + "author": "DscSamples", + "description": "The `GitConfigUserName` DSC resource is used to manage the Git user name configuration.", + "capabilities": ["get", "test", "set"], + "schema": { + "embedded": { + "type": "object", + "required": ["UserName"], + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "Ensure": { + "type": "string", + "enum": ["Absent", "Present"], + "title": "Ensure", + "description": "Specifies whether the user name should be present or absent. Defaults to `Present`." + }, + "UserName": { + "type": "string", + "title": "UserName", + "description": "The Git user name to configure. This is a key property." + }, + "ConfigLocation": { + "type": "string", + "enum": ["none", "global", "system", "worktree", "local"], + "title": "ConfigLocation", + "description": "The Git configuration scope to apply the setting to (e.g., `global`, `system`, `local`)." + }, + "ProjectDirectory": { + "type": "string", + "title": "ProjectDirectory", + "description": "The path to the Git repository. Required for non-global and non-system configurations." + } + }, + "description": "The `GitConfigUserName` DSC resource is used to manage the Git user name configuration.", + "title": "GitDsc/GitConfigUserName" + } + }, + "path": "GitDsc.psd1" + }, + { + "requireAdapter": "Microsoft.Adapter/PowerShell", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/adaptedresource/manifest.json", + "kind": "resource", + "version": "0.1.0", + "type": "GitDsc/GitConfigUserEmail", + "author": "DscSamples", + "description": "The `GitConfigUserEmail` DSC resource is used to manage the Git user email configuration.", + "capabilities": ["get", "test", "set"], + "schema": { + "embedded": { + "type": "object", + "required": ["UserEmail"], + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "Ensure": { + "type": "string", + "enum": ["Absent", "Present"], + "title": "Ensure", + "description": "Specifies whether the user email should be present or absent. Defaults to `Present`." + }, + "UserEmail": { + "type": "string", + "title": "UserEmail", + "description": "The Git user email to configure. This is a key property." + }, + "ConfigLocation": { + "type": "string", + "enum": ["none", "global", "system", "worktree", "local"], + "title": "ConfigLocation", + "description": "The Git configuration scope to apply the setting to (e.g., `global`, `system`, `local`)." + }, + "ProjectDirectory": { + "type": "string", + "title": "ProjectDirectory", + "description": "The path to the Git repository. Required for non-global and non-system configurations." + } + }, + "description": "The `GitConfigUserEmail` DSC resource is used to manage the Git user email configuration.", + "title": "GitDsc/GitConfigUserEmail" + } + }, + "path": "GitDsc.psd1" + } + ] +} diff --git a/resources/Microsoft.DotNet.Dsc/microsoftdotnetdsc.dsc.manifests.json b/resources/Microsoft.DotNet.Dsc/microsoftdotnetdsc.dsc.manifests.json new file mode 100644 index 00000000..7841e0a5 --- /dev/null +++ b/resources/Microsoft.DotNet.Dsc/microsoftdotnetdsc.dsc.manifests.json @@ -0,0 +1,60 @@ +{ + "adaptedResources": [ + { + "requireAdapter": "Microsoft.Adapter/PowerShell", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/adaptedresource/manifest.json", + "kind": "resource", + "version": "0.1.0", + "type": "Microsoft.DotNet.Dsc/DotNetToolPackage", + "author": "Microsoft Corporation", + "description": "The `DotNetToolPackage` DSC Resource allows you to install, update, and uninstall .NET tool packages using the dotnet CLI.", + "capabilities": ["get", "set", "test", "export"], + "schema": { + "embedded": { + "type": "object", + "required": ["PackageId"], + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "PackageId": { + "type": "string", + "title": "PackageId", + "description": "The ID of the .NET tool package to manage. This is a required parameter.\r\n\r\n For a list of available .NET tool packages, see the following link: https://www.nuget.org/packages?q=&includeComputedFrameworks=true&packagetype=dotnettool&prerel=true&sortby=relevance" + }, + "Version": { + "type": "string", + "title": "Version", + "description": "The version of the .NET tool package to install. If not specified, the latest version will be installed." + }, + "Commands": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Commands", + "description": "An array of commands provided by the .NET tool package. This parameter is optional." + }, + "Prerelease": { + "type": "boolean", + "title": "Prerelease", + "description": "Indicates whether to include prerelease versions of the .NET tool package. The default value is $false." + }, + "ToolPathDirectory": { + "type": "string", + "title": "ToolPathDirectory", + "description": "The directory where the .NET tool package will be installed. If not specified, the package will be installed globally." + }, + "Exist": { + "type": "boolean", + "title": "Exist", + "description": "Indicates whether the package should exist. Defaults to $true." + } + }, + "description": "The `DotNetToolPackage` DSC Resource allows you to install, update, and uninstall .NET tool packages using the dotnet CLI.", + "title": "Microsoft.DotNet.Dsc/DotNetToolPackage" + } + }, + "path": "Microsoft.DotNet.Dsc.psd1" + } + ] +} diff --git a/resources/Microsoft.VSCode.Dsc/microsoftvscodedsc.dsc.manifests.json b/resources/Microsoft.VSCode.Dsc/microsoftvscodedsc.dsc.manifests.json new file mode 100644 index 00000000..1cbf4cf2 --- /dev/null +++ b/resources/Microsoft.VSCode.Dsc/microsoftvscodedsc.dsc.manifests.json @@ -0,0 +1,52 @@ +{ + "adaptedResources": [ + { + "requireAdapter": "Microsoft.Adapter/PowerShell", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/adaptedresource/manifest.json", + "kind": "resource", + "version": "0.1.0", + "type": "Microsoft.VSCode.Dsc/VSCodeExtension", + "author": "Microsoft Corporation", + "description": "The `VSCodeExtension` DSC Resource allows you to install, update, and remove Visual Studio Code extensions. This resource ensures that the specified Visual Studio Code extension is in the desired state.", + "capabilities": ["export", "get", "test", "set"], + "schema": { + "embedded": { + "type": "object", + "required": ["Name"], + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "Name": { + "type": "string", + "title": "Name", + "description": "The name of the Visual Studio Code extension to manage. This is a required parameter." + }, + "Version": { + "type": "string", + "title": "Version", + "description": "The version of the Visual Studio Code extension to install. If not specified, the latest version will be installed." + }, + "Exist": { + "type": "boolean", + "title": "Exist", + "description": "Indicates whether the extension should exist. The default value is `$true`." + }, + "PreRelease": { + "type": "boolean", + "title": "PreRelease", + "description": "Indicates whether to install the pre-release version of the extension. The default value is `$false`.\r\n\r\n When PreRelease is set to `$true`, the extension will be installed from the Visual Studio Code marketplace. If the extension is already installed, it will be updated to the pre-release version.\r\n If there is no prerelease version available, the extension will be installed." + }, + "Insiders": { + "type": "boolean", + "title": "Insiders", + "description": "Indicates whether to manage the extension for the Insiders version of Visual Studio Code. The default value is `$false`." + } + }, + "description": "The `VSCodeExtension` DSC Resource allows you to install, update, and remove Visual Studio Code extensions. This resource ensures that the specified Visual Studio Code extension is in the desired state.", + "title": "Microsoft.VSCode.Dsc/VSCodeExtension" + } + }, + "path": "Microsoft.VSCode.Dsc.psd1" + } + ] +} diff --git a/resources/Microsoft.Windows.Developer/Microsoft.Windows.Developer.psm1 b/resources/Microsoft.Windows.Developer/Microsoft.Windows.Developer.psm1 index d38de37e..ca2116fc 100644 --- a/resources/Microsoft.Windows.Developer/Microsoft.Windows.Developer.psm1 +++ b/resources/Microsoft.Windows.Developer/Microsoft.Windows.Developer.psm1 @@ -76,6 +76,37 @@ enum Direction { } #region DSCResources +<# + .SYNOPSIS + The `DeveloperMode` DSC resource is used to enable or disable Windows Developer Mode. + + .DESCRIPTION + The `DeveloperMode` DSC resource configures the Windows Developer Mode setting, which + allows sideloading of apps and other developer-focused features. + + ## Requirements + + * Target machine must be running Windows. + * This resource must be run as an Administrator. + + .PARAMETER SID + The security identifier. This is a key property and should not be set manually. + + .PARAMETER Ensure + Specifies whether Developer Mode should be enabled (`Present`) or disabled (`Absent`). + Defaults to `Present`. + + .PARAMETER IsEnabled + A read-only property indicating whether Developer Mode is currently enabled. + This property is not configurable. + + .EXAMPLE + Invoke-DscResource -ModuleName Microsoft.Windows.Developer -Name DeveloperMode -Method Set -Property @{ + Ensure = 'Present' + } + + This example enables Windows Developer Mode. +#> [DSCResource()] class DeveloperMode { # Key required. Do not set. @@ -132,6 +163,36 @@ class DeveloperMode { } } +<# + .SYNOPSIS + The `OsVersion` DSC resource is used to assert a minimum Windows operating system version requirement. + + .DESCRIPTION + The `OsVersion` DSC resource validates that the target machine is running at least the + specified minimum version of Windows. This resource is read-only and does not modify + any system settings. + + ## Requirements + + * Target machine must be running Windows. + + .PARAMETER SID + The security identifier. This is a key property and should not be set manually. + + .PARAMETER MinVersion + The minimum required version of the operating system. This is a mandatory property. + + .PARAMETER OsVersion + A read-only property indicating the current operating system version. + This property is not configurable. + + .EXAMPLE + Invoke-DscResource -ModuleName Microsoft.Windows.Developer -Name OsVersion -Method Test -Property @{ + MinVersion = '10.0.19041.0' + } + + This example asserts that the machine is running Windows 10 version 2004 or later. +#> [DSCResource()] class OsVersion { # Key required. Do not set. @@ -179,6 +240,52 @@ if ([string]::IsNullOrEmpty($env:TestRegistryPath)) { $global:ExplorerRegistryPath = $global:PersonalizeRegistryPath = $global:SearchRegistryPath = $global:UACRegistryPath = $global:RemoteDesktopRegistryPath = $global:LongPathsRegistryPath = $env:TestRegistryPath } +<# + .SYNOPSIS + The `Taskbar` DSC resource is used to manage Windows taskbar settings. + + .DESCRIPTION + The `Taskbar` DSC resource configures taskbar properties including alignment, + label hide behavior, search box mode, the Task View button, and the Widgets button. + + ## Requirements + + * Target machine must be running Windows. + + .PARAMETER SID + The security identifier. This is a key property and should not be set manually. + + .PARAMETER Alignment + Sets the taskbar alignment. Accepted values are `Left` or `Middle`. + Defaults to `KeepCurrentValue`. + + .PARAMETER HideLabelsMode + Sets the taskbar button label hide behavior. Accepted values are `Always`, `WhenFull`, or `Never`. + Defaults to `KeepCurrentValue`. + + .PARAMETER SearchboxMode + Sets the search box display mode. Accepted values are `Hide`, `ShowIconOnly`, `SearchBox`, or `ShowIconAndLabel`. + Defaults to `KeepCurrentValue`. + + .PARAMETER TaskViewButton + Shows or hides the Task View button on the taskbar. + Defaults to `KeepCurrentValue`. + + .PARAMETER WidgetsButton + Shows or hides the Widgets button on the taskbar. + Defaults to `KeepCurrentValue`. + + .PARAMETER RestartExplorer + Specifies whether to restart Windows Explorer to apply changes. Defaults to `$false`. + + .EXAMPLE + Invoke-DscResource -ModuleName Microsoft.Windows.Developer -Name Taskbar -Method Set -Property @{ + Alignment = 'Left' + SearchboxMode = 'Hide' + } + + This example aligns the taskbar to the left and hides the search box. +#> [DSCResource()] class Taskbar { [DscProperty()] [Alignment] $Alignment = [Alignment]::KeepCurrentValue @@ -325,6 +432,41 @@ class Taskbar { } } +<# + .SYNOPSIS + The `WindowsExplorer` DSC resource is used to manage Windows Explorer settings. + + .DESCRIPTION + The `WindowsExplorer` DSC resource configures Windows Explorer settings including + the visibility of file extensions, hidden files, and item checkboxes in File Explorer. + + ## Requirements + + * Target machine must be running Windows. + + .PARAMETER SID + The security identifier. This is a key property and should not be set manually. + + .PARAMETER FileExtensions + Shows or hides file extensions in File Explorer. Defaults to `KeepCurrentValue`. + + .PARAMETER HiddenFiles + Shows or hides hidden files and folders in File Explorer. Defaults to `KeepCurrentValue`. + + .PARAMETER ItemCheckBoxes + Shows or hides item checkboxes in File Explorer. Defaults to `KeepCurrentValue`. + + .PARAMETER RestartExplorer + Specifies whether to restart Windows Explorer to apply changes. Defaults to `$false`. + + .EXAMPLE + Invoke-DscResource -ModuleName Microsoft.Windows.Developer -Name WindowsExplorer -Method Set -Property @{ + FileExtensions = 'Show' + HiddenFiles = 'Show' + } + + This example configures File Explorer to show file extensions and hidden files. +#> [DSCResource()] class WindowsExplorer { [DscProperty()] [ShowHideFeature] $FileExtensions = [ShowHideFeature]::KeepCurrentValue @@ -412,6 +554,33 @@ class WindowsExplorer { } } +<# + .SYNOPSIS + The `UserAccessControl` DSC resource is used to manage the User Account Control (UAC) prompt behavior. + + .DESCRIPTION + The `UserAccessControl` DSC resource configures the administrator consent prompt behavior + for User Account Control (UAC) on Windows. + + ## Requirements + + * Target machine must be running Windows. + + .PARAMETER SID + The security identifier. This is a key property and should not be set manually. + + .PARAMETER AdminConsentPromptBehavior + Specifies the UAC admin consent prompt behavior. Accepted values are `NoCredOrConsentRequired`, + `RequireCredOnSecureDesktop`, `RequireConsentOnSecureDesktop`, `RequireCred`, + `RequireConsent`, or `RequireConsentForNonWindowsBinaries`. Defaults to `KeepCurrentValue`. + + .EXAMPLE + Invoke-DscResource -ModuleName Microsoft.Windows.Developer -Name UserAccessControl -Method Set -Property @{ + AdminConsentPromptBehavior = 'RequireConsentForNonWindowsBinaries' + } + + This example sets the UAC prompt to require consent for non-Windows binaries. +#> [DSCResource()] class UserAccessControl { # Key required. Do not set. @@ -471,6 +640,35 @@ class UserAccessControl { } } +<# + .SYNOPSIS + The `EnableDarkMode` DSC resource is used to enable or disable Windows dark mode. + + .DESCRIPTION + The `EnableDarkMode` DSC resource sets both the app and system color mode to dark or + light by configuring the corresponding Windows registry keys. + + ## Requirements + + * Target machine must be running Windows. + + .PARAMETER SID + The security identifier. This is a key property and should not be set manually. + + .PARAMETER Ensure + Specifies whether dark mode should be enabled (`Present`) or disabled (`Absent`). + Defaults to `Present`. + + .PARAMETER RestartExplorer + Specifies whether to restart Windows Explorer to apply changes. Defaults to `$false`. + + .EXAMPLE + Invoke-DscResource -ModuleName Microsoft.Windows.Developer -Name EnableDarkMode -Method Set -Property @{ + Ensure = 'Present' + } + + This example enables Windows dark mode for both apps and the system. +#> [DSCResource()] class EnableDarkMode { # Key required. Do not set. @@ -521,6 +719,32 @@ class EnableDarkMode { } } +<# + .SYNOPSIS + The `ShowSecondsInClock` DSC resource is used to show or hide seconds in the taskbar clock. + + .DESCRIPTION + The `ShowSecondsInClock` DSC resource configures the Windows registry to include or + exclude the seconds display in the system clock on the taskbar. + + ## Requirements + + * Target machine must be running Windows. + + .PARAMETER SID + The security identifier. This is a key property and should not be set manually. + + .PARAMETER Ensure + Specifies whether seconds should be shown (`Present`) or hidden (`Absent`) in the clock. + Defaults to `Present`. + + .EXAMPLE + Invoke-DscResource -ModuleName Microsoft.Windows.Developer -Name ShowSecondsInClock -Method Set -Property @{ + Ensure = 'Present' + } + + This example enables showing seconds in the Windows taskbar clock. +#> [DSCResource()] class ShowSecondsInClock { # Key required. Do not set. @@ -558,6 +782,32 @@ class ShowSecondsInClock { } } +<# + .SYNOPSIS + The `EnableRemoteDesktop` DSC resource is used to enable or disable Remote Desktop connections. + + .DESCRIPTION + The `EnableRemoteDesktop` DSC resource configures the Windows registry to allow or + deny Remote Desktop Protocol (RDP) connections to the target machine. + + ## Requirements + + * Target machine must be running Windows. + + .PARAMETER SID + The security identifier. This is a key property and should not be set manually. + + .PARAMETER Ensure + Specifies whether Remote Desktop should be enabled (`Present`) or disabled (`Absent`). + Defaults to `Present`. + + .EXAMPLE + Invoke-DscResource -ModuleName Microsoft.Windows.Developer -Name EnableRemoteDesktop -Method Set -Property @{ + Ensure = 'Present' + } + + This example enables Remote Desktop connections on the target machine. +#> [DSCResource()] class EnableRemoteDesktop { # Key required. Do not set. @@ -597,6 +847,32 @@ class EnableRemoteDesktop { } } +<# + .SYNOPSIS + The `EnableLongPathSupport` DSC resource is used to enable or disable Windows long path support. + + .DESCRIPTION + The `EnableLongPathSupport` DSC resource configures the Windows registry to enable or + disable support for file and directory paths longer than 260 characters (MAX_PATH). + + ## Requirements + + * Target machine must be running Windows 10 version 1607 or later. + + .PARAMETER SID + The security identifier. This is a key property and should not be set manually. + + .PARAMETER Ensure + Specifies whether long path support should be enabled (`Present`) or disabled (`Absent`). + Defaults to `Present`. + + .EXAMPLE + Invoke-DscResource -ModuleName Microsoft.Windows.Developer -Name EnableLongPathSupport -Method Set -Property @{ + Ensure = 'Present' + } + + This example enables long path support on Windows. +#> [DSCResource()] class EnableLongPathSupport { # Key required. Do not set. @@ -638,6 +914,45 @@ class EnableLongPathSupport { } } +<# + .SYNOPSIS + The `PowerPlanSetting` DSC resource is used to manage Windows power plan settings. + + .DESCRIPTION + The `PowerPlanSetting` DSC resource configures timeout values for the active Windows + power plan, such as the display timeout and sleep timeout for plugged-in or battery + power sources. + + ## Requirements + + * Target machine must be running Windows. + + .PARAMETER Name + The name of the power plan setting to configure. Accepted values are `DisplayTimeout` + or `SleepTimeout`. This is a key and mandatory property. + + .PARAMETER PowerSource + The power source for the setting. Accepted values are `PluggedIn`, `Battery`, or `All`. + This is a mandatory property. + + .PARAMETER SettingValue + The timeout value in seconds. This is a mandatory property. + + .PARAMETER PluggedInValue + A read-only property indicating the current plugged-in timeout value. This property is not configurable. + + .PARAMETER BatteryValue + A read-only property indicating the current battery timeout value. This property is not configurable. + + .EXAMPLE + Invoke-DscResource -ModuleName Microsoft.Windows.Developer -Name PowerPlanSetting -Method Set -Property @{ + Name = 'DisplayTimeout' + PowerSource = 'PluggedIn' + SettingValue = 300 + } + + This example sets the display timeout to 300 seconds (5 minutes) when the machine is plugged in. +#> [DSCResource()] class PowerPlanSetting { [DscProperty(Key, Mandatory)] @@ -658,7 +973,7 @@ class PowerPlanSetting { [PowerPlanSetting] Get() { function Get-PowerPlanSetting ([PowerPlanSettingName] $SettingName) { - Begin { + begin { # If a power plan group policy is set, the power settings cannot be obtained, so temporarily disable it. $GPReg = Backup-GroupPolicyPowerPlanSetting if ($GPReg) { @@ -666,7 +981,7 @@ class PowerPlanSetting { } } - Process { + process { $SettingGUID = ($SettingName -eq [PowerPlanSettingName]::DisplayTimeout) ? $DisplayTimeoutSettingGUID : $SleepTimeoutSettingGUID $PowerPlan = Get-ActivePowerPlan $planID = $PowerPlan.InstanceId.Split('\')[1] -replace '[{}]' @@ -690,7 +1005,7 @@ class PowerPlanSetting { return $ReturnValue } - End { + end { if ($GPReg) { # Restore the group policies Restore-GroupPolicyPowerPlanSetting -GPRegArray $GPReg @@ -728,14 +1043,14 @@ class PowerPlanSetting { [void] Set() { function Set-PowerPlanSetting ([PowerPlanSettingName] $PowerPlanSettingName, [PowerSource]$PowerSource, [int]$Value) { - Begin { + begin { # If a power plan group policy is set, the power settings cannot be obtained, so temporarily disable it. $GPReg = Backup-GroupPolicyPowerPlanSetting if ($GPReg) { Disable-GroupPolicyPowerPlanSetting } } - Process { + process { $SettingGUID = ($PowerPlanSettingName -eq [PowerPlanSettingName]::DisplayTimeout) ? $DisplayTimeoutSettingGUID : $SleepTimeoutSettingGUID $PowerPlan = Get-ActivePowerPlan $planID = $PowerPlan.InstanceId.Split('\')[1] -replace '[{}]' @@ -757,7 +1072,7 @@ class PowerPlanSetting { Set-CimInstance -CimInstance $Instance } } - End { + end { if ($GPReg) { # Restore the group policies Restore-GroupPolicyPowerPlanSetting -GPRegArray $GPReg @@ -771,6 +1086,34 @@ class PowerPlanSetting { } } +<# + .SYNOPSIS + The `WindowsCapability` DSC resource is used to install or remove Windows optional features. + + .DESCRIPTION + The `WindowsCapability` DSC resource adds or removes Windows optional features by name + using the `Add-WindowsCapability` and `Remove-WindowsCapability` cmdlets. + + ## Requirements + + * Target machine must be running Windows. + * This resource may require Administrator privileges. + + .PARAMETER Name + The name of the Windows capability to manage. This is a key and mandatory property. + + .PARAMETER Ensure + Specifies whether the capability should be installed (`Present`) or removed (`Absent`). + Defaults to `Present`. + + .EXAMPLE + Invoke-DscResource -ModuleName Microsoft.Windows.Developer -Name WindowsCapability -Method Set -Property @{ + Name = 'OpenSSH.Client~~~~0.0.1.0' + Ensure = 'Present' + } + + This example installs the OpenSSH Client Windows capability. +#> [DSCResource()] class WindowsCapability { [DscProperty(Key, Mandatory)] @@ -816,6 +1159,36 @@ class WindowsCapability { } } +<# + .SYNOPSIS + The `NetConnectionProfile` DSC resource is used to manage the network connection profile for a network adapter. + + .DESCRIPTION + The `NetConnectionProfile` DSC resource sets the network category (e.g., `Public`, `Private`, + or `DomainAuthenticated`) for the specified network interface. + + ## Requirements + + * Target machine must be running Windows. + + .PARAMETER SID + The security identifier. This is a key property and should not be set manually. + + .PARAMETER InterfaceAlias + The alias of the network interface to configure. This is a mandatory property. + + .PARAMETER NetworkCategory + The network category to assign. Accepted values are `Public`, `Private`, or `DomainAuthenticated`. + This is a mandatory property. + + .EXAMPLE + Invoke-DscResource -ModuleName Microsoft.Windows.Developer -Name NetConnectionProfile -Method Set -Property @{ + InterfaceAlias = 'Ethernet' + NetworkCategory = 'Private' + } + + This example sets the Ethernet adapter's network profile to Private. +#> [DSCResource()] class NetConnectionProfile { # Key required. Do not set. @@ -853,6 +1226,38 @@ class NetConnectionProfile { } } +<# + .SYNOPSIS + The `AdvancedNetworkSharingSetting` DSC resource is used to manage Windows advanced network sharing settings. + + .DESCRIPTION + The `AdvancedNetworkSharingSetting` DSC resource enables or disables Network Discovery + and File and Printer Sharing for the specified network profiles by managing the + corresponding Windows Firewall rules. + + ## Requirements + + * Target machine must be running Windows. + + .PARAMETER Name + The advanced sharing setting to configure. Accepted values are `NetworkDiscovery` + or `FileAndPrinterSharing`. This is a key and mandatory property. + + .PARAMETER Profiles + The network profiles for which the setting should be enabled (e.g., `Domain`, `Private`, `Public`). + + .PARAMETER EnabledProfiles + A read-only property listing the profiles for which the setting is currently enabled. + This property is not configurable. + + .EXAMPLE + Invoke-DscResource -ModuleName Microsoft.Windows.Developer -Name AdvancedNetworkSharingSetting -Method Set -Property @{ + Name = 'NetworkDiscovery' + Profiles = @('Private', 'Domain') + } + + This example enables Network Discovery for Private and Domain network profiles. +#> [DSCResource()] class AdvancedNetworkSharingSetting { [DscProperty(Key, Mandatory)] @@ -918,7 +1323,7 @@ class AdvancedNetworkSharingSetting { } #Disable needed if at least one profile is enabled - $profilesToDisable = Get-NetFirewallRule -Group $group | Where-Object { ($_.Enabled -eq 'True') -and (-not $this.Profiles -Contains $_.Profile ) } | Select-Object -Unique -CaseInsensitive -ExpandProperty Profile + $profilesToDisable = Get-NetFirewallRule -Group $group | Where-Object { ($_.Enabled -eq 'True') -and (-not $this.Profiles -contains $_.Profile ) } | Select-Object -Unique -CaseInsensitive -ExpandProperty Profile foreach ($profile in $profilesToDisable) { Set-NetFirewallRule -Group $group -Profile $profile -Enabled False } @@ -926,6 +1331,61 @@ class AdvancedNetworkSharingSetting { } } +<# + .SYNOPSIS + The `FirewallRule` DSC resource is used to create, modify, or remove Windows Firewall rules. + + .DESCRIPTION + The `FirewallRule` DSC resource manages Windows Firewall rules by name, allowing you to + configure the action, direction, ports, protocols, and profiles for each rule. + + ## Requirements + + * Target machine must be running Windows. + + .PARAMETER Name + The unique name of the firewall rule. This is a key and mandatory property. + + .PARAMETER Ensure + Specifies whether the firewall rule should be present or absent. Defaults to `Present`. + + .PARAMETER DisplayName + The display name of the firewall rule. + + .PARAMETER Action + The action for the firewall rule. Accepted values are `NotConfigured`, `Allow`, or `Block`. + + .PARAMETER Description + A description for the firewall rule. + + .PARAMETER Direction + The direction of the firewall rule. Accepted values are `Inbound` or `Outbound`. + + .PARAMETER Enabled + Specifies whether the firewall rule is enabled. + + .PARAMETER LocalPort + The local ports to which the rule applies. + + .PARAMETER Profiles + The network profiles to which the rule applies (e.g., `Domain`, `Private`, `Public`). + + .PARAMETER Protocol + The protocol for the firewall rule (e.g., `TCP`, `UDP`). + + .EXAMPLE + Invoke-DscResource -ModuleName Microsoft.Windows.Developer -Name FirewallRule -Method Set -Property @{ + Name = 'MyApp-Inbound-TCP-8080' + Ensure = 'Present' + Action = 'Allow' + Direction = 'Inbound' + LocalPort = @('8080') + Protocol = 'TCP' + Enabled = $true + } + + This example creates a firewall rule to allow inbound TCP traffic on port 8080. +#> [DSCResource()] class FirewallRule { [DscProperty(Key, Mandatory)] diff --git a/resources/Microsoft.Windows.Developer/microsoftwindowsdeveloper.dsc.manifests.json b/resources/Microsoft.Windows.Developer/microsoftwindowsdeveloper.dsc.manifests.json new file mode 100644 index 00000000..9b066409 --- /dev/null +++ b/resources/Microsoft.Windows.Developer/microsoftwindowsdeveloper.dsc.manifests.json @@ -0,0 +1,638 @@ +{ + "adaptedResources": [ + { + "requireAdapter": "Microsoft.Adapter/PowerShell", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/adaptedresource/manifest.json", + "kind": "resource", + "version": "0.1.0", + "type": "Microsoft.Windows.Developer/DeveloperMode", + "author": "Microsoft Corporation", + "description": "The `DeveloperMode` DSC resource is used to enable or disable Windows Developer Mode.", + "capabilities": ["get", "test", "set"], + "schema": { + "embedded": { + "type": "object", + "required": ["SID"], + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "SID": { + "type": "string", + "title": "SID", + "description": "The security identifier. This is a key property and should not be set manually." + }, + "Ensure": { + "type": "string", + "enum": ["Absent", "Present"], + "title": "Ensure", + "description": "Specifies whether Developer Mode should be enabled (`Present`) or disabled (`Absent`).\r\n Defaults to `Present`." + }, + "IsEnabled": { + "type": "boolean", + "title": "IsEnabled", + "readOnly": true, + "description": "A read-only property indicating whether Developer Mode is currently enabled.\r\n This property is not configurable." + } + }, + "description": "The `DeveloperMode` DSC resource is used to enable or disable Windows Developer Mode.", + "title": "Microsoft.Windows.Developer/DeveloperMode" + } + }, + "path": "Microsoft.Windows.Developer.psd1" + }, + { + "requireAdapter": "Microsoft.Adapter/PowerShell", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/adaptedresource/manifest.json", + "kind": "resource", + "version": "0.1.0", + "type": "Microsoft.Windows.Developer/OsVersion", + "author": "Microsoft Corporation", + "description": "The `OsVersion` DSC resource is used to assert a minimum Windows operating system version requirement.", + "capabilities": ["get", "test", "set"], + "schema": { + "embedded": { + "type": "object", + "required": ["SID", "MinVersion"], + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "SID": { + "type": "string", + "title": "SID", + "description": "The security identifier. This is a key property and should not be set manually." + }, + "MinVersion": { + "type": "string", + "title": "MinVersion", + "description": "The minimum required version of the operating system. This is a mandatory property." + }, + "OsVersion": { + "type": "string", + "title": "OsVersion", + "readOnly": true, + "description": "A read-only property indicating the current operating system version.\r\n This property is not configurable." + } + }, + "description": "The `OsVersion` DSC resource is used to assert a minimum Windows operating system version requirement.", + "title": "Microsoft.Windows.Developer/OsVersion" + } + }, + "path": "Microsoft.Windows.Developer.psd1" + }, + { + "requireAdapter": "Microsoft.Adapter/PowerShell", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/adaptedresource/manifest.json", + "kind": "resource", + "version": "0.1.0", + "type": "Microsoft.Windows.Developer/Taskbar", + "author": "Microsoft Corporation", + "description": "The `Taskbar` DSC resource is used to manage Windows taskbar settings.", + "capabilities": ["get", "test", "set"], + "schema": { + "embedded": { + "type": "object", + "required": ["SID"], + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "Alignment": { + "type": "string", + "enum": ["KeepCurrentValue", "Left", "Middle"], + "title": "Alignment", + "description": "Sets the taskbar alignment. Accepted values are `Left` or `Middle`.\r\n Defaults to `KeepCurrentValue`." + }, + "HideLabelsMode": { + "type": "string", + "enum": ["KeepCurrentValue", "Always", "WhenFull", "Never"], + "title": "HideLabelsMode", + "description": "Sets the taskbar button label hide behavior. Accepted values are `Always`, `WhenFull`, or `Never`.\r\n Defaults to `KeepCurrentValue`." + }, + "SearchboxMode": { + "type": "string", + "enum": [ + "KeepCurrentValue", + "Hide", + "ShowIconOnly", + "SearchBox", + "ShowIconAndLabel" + ], + "title": "SearchboxMode", + "description": "Sets the search box display mode. Accepted values are `Hide`, `ShowIconOnly`, `SearchBox`, or `ShowIconAndLabel`.\r\n Defaults to `KeepCurrentValue`." + }, + "TaskViewButton": { + "type": "string", + "enum": ["KeepCurrentValue", "Hide", "Show"], + "title": "TaskViewButton", + "description": "Shows or hides the Task View button on the taskbar.\r\n Defaults to `KeepCurrentValue`." + }, + "WidgetsButton": { + "type": "string", + "enum": ["KeepCurrentValue", "Hide", "Show"], + "title": "WidgetsButton", + "description": "Shows or hides the Widgets button on the taskbar.\r\n Defaults to `KeepCurrentValue`." + }, + "RestartExplorer": { + "type": "boolean", + "title": "RestartExplorer", + "description": "Specifies whether to restart Windows Explorer to apply changes. Defaults to `$false`." + }, + "SID": { + "type": "string", + "title": "SID", + "description": "The security identifier. This is a key property and should not be set manually." + } + }, + "description": "The `Taskbar` DSC resource is used to manage Windows taskbar settings.", + "title": "Microsoft.Windows.Developer/Taskbar" + } + }, + "path": "Microsoft.Windows.Developer.psd1" + }, + { + "requireAdapter": "Microsoft.Adapter/PowerShell", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/adaptedresource/manifest.json", + "kind": "resource", + "version": "0.1.0", + "type": "Microsoft.Windows.Developer/WindowsExplorer", + "author": "Microsoft Corporation", + "description": "The `WindowsExplorer` DSC resource is used to manage Windows Explorer settings.", + "capabilities": ["get", "test", "set"], + "schema": { + "embedded": { + "type": "object", + "required": ["SID"], + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "FileExtensions": { + "type": "string", + "enum": ["KeepCurrentValue", "Hide", "Show"], + "title": "FileExtensions", + "description": "Shows or hides file extensions in File Explorer. Defaults to `KeepCurrentValue`." + }, + "HiddenFiles": { + "type": "string", + "enum": ["KeepCurrentValue", "Hide", "Show"], + "title": "HiddenFiles", + "description": "Shows or hides hidden files and folders in File Explorer. Defaults to `KeepCurrentValue`." + }, + "ItemCheckBoxes": { + "type": "string", + "enum": ["KeepCurrentValue", "Hide", "Show"], + "title": "ItemCheckBoxes", + "description": "Shows or hides item checkboxes in File Explorer. Defaults to `KeepCurrentValue`." + }, + "RestartExplorer": { + "type": "boolean", + "title": "RestartExplorer", + "description": "Specifies whether to restart Windows Explorer to apply changes. Defaults to `$false`." + }, + "SID": { + "type": "string", + "title": "SID", + "description": "The security identifier. This is a key property and should not be set manually." + } + }, + "description": "The `WindowsExplorer` DSC resource is used to manage Windows Explorer settings.", + "title": "Microsoft.Windows.Developer/WindowsExplorer" + } + }, + "path": "Microsoft.Windows.Developer.psd1" + }, + { + "requireAdapter": "Microsoft.Adapter/PowerShell", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/adaptedresource/manifest.json", + "kind": "resource", + "version": "0.1.0", + "type": "Microsoft.Windows.Developer/UserAccessControl", + "author": "Microsoft Corporation", + "description": "The `UserAccessControl` DSC resource is used to manage the User Account Control (UAC) prompt behavior.", + "capabilities": ["get", "test", "set"], + "schema": { + "embedded": { + "type": "object", + "required": ["SID"], + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "SID": { + "type": "string", + "title": "SID", + "description": "The security identifier. This is a key property and should not be set manually." + }, + "AdminConsentPromptBehavior": { + "type": "string", + "enum": [ + "KeepCurrentValue", + "NoCredOrConsentRequired", + "RequireCredOnSecureDesktop", + "RequireConsentOnSecureDesktop", + "RequireCred", + "RequireConsent", + "RequireConsentForNonWindowsBinaries" + ], + "title": "AdminConsentPromptBehavior", + "description": "Specifies the UAC admin consent prompt behavior. Accepted values are `NoCredOrConsentRequired`,\r\n `RequireCredOnSecureDesktop`, `RequireConsentOnSecureDesktop`, `RequireCred`,\r\n `RequireConsent`, or `RequireConsentForNonWindowsBinaries`. Defaults to `KeepCurrentValue`." + } + }, + "description": "The `UserAccessControl` DSC resource is used to manage the User Account Control (UAC) prompt behavior.", + "title": "Microsoft.Windows.Developer/UserAccessControl" + } + }, + "path": "Microsoft.Windows.Developer.psd1" + }, + { + "requireAdapter": "Microsoft.Adapter/PowerShell", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/adaptedresource/manifest.json", + "kind": "resource", + "version": "0.1.0", + "type": "Microsoft.Windows.Developer/EnableDarkMode", + "author": "Microsoft Corporation", + "description": "The `EnableDarkMode` DSC resource is used to enable or disable Windows dark mode.", + "capabilities": ["get", "test", "set"], + "schema": { + "embedded": { + "type": "object", + "required": ["SID"], + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "SID": { + "type": "string", + "title": "SID", + "description": "The security identifier. This is a key property and should not be set manually." + }, + "Ensure": { + "type": "string", + "enum": ["Absent", "Present"], + "title": "Ensure", + "description": "Specifies whether dark mode should be enabled (`Present`) or disabled (`Absent`).\r\n Defaults to `Present`." + }, + "RestartExplorer": { + "type": "boolean", + "title": "RestartExplorer", + "description": "Specifies whether to restart Windows Explorer to apply changes. Defaults to `$false`." + } + }, + "description": "The `EnableDarkMode` DSC resource is used to enable or disable Windows dark mode.", + "title": "Microsoft.Windows.Developer/EnableDarkMode" + } + }, + "path": "Microsoft.Windows.Developer.psd1" + }, + { + "requireAdapter": "Microsoft.Adapter/PowerShell", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/adaptedresource/manifest.json", + "kind": "resource", + "version": "0.1.0", + "type": "Microsoft.Windows.Developer/ShowSecondsInClock", + "author": "Microsoft Corporation", + "description": "The `ShowSecondsInClock` DSC resource is used to show or hide seconds in the taskbar clock.", + "capabilities": ["get", "test", "set"], + "schema": { + "embedded": { + "type": "object", + "required": ["SID"], + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "SID": { + "type": "string", + "title": "SID", + "description": "The security identifier. This is a key property and should not be set manually." + }, + "Ensure": { + "type": "string", + "enum": ["Absent", "Present"], + "title": "Ensure", + "description": "Specifies whether seconds should be shown (`Present`) or hidden (`Absent`) in the clock.\r\n Defaults to `Present`." + } + }, + "description": "The `ShowSecondsInClock` DSC resource is used to show or hide seconds in the taskbar clock.", + "title": "Microsoft.Windows.Developer/ShowSecondsInClock" + } + }, + "path": "Microsoft.Windows.Developer.psd1" + }, + { + "requireAdapter": "Microsoft.Adapter/PowerShell", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/adaptedresource/manifest.json", + "kind": "resource", + "version": "0.1.0", + "type": "Microsoft.Windows.Developer/EnableRemoteDesktop", + "author": "Microsoft Corporation", + "description": "The `EnableRemoteDesktop` DSC resource is used to enable or disable Remote Desktop connections.", + "capabilities": ["get", "test", "set"], + "schema": { + "embedded": { + "type": "object", + "required": ["SID"], + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "SID": { + "type": "string", + "title": "SID", + "description": "The security identifier. This is a key property and should not be set manually." + }, + "Ensure": { + "type": "string", + "enum": ["Absent", "Present"], + "title": "Ensure", + "description": "Specifies whether Remote Desktop should be enabled (`Present`) or disabled (`Absent`).\r\n Defaults to `Present`." + } + }, + "description": "The `EnableRemoteDesktop` DSC resource is used to enable or disable Remote Desktop connections.", + "title": "Microsoft.Windows.Developer/EnableRemoteDesktop" + } + }, + "path": "Microsoft.Windows.Developer.psd1" + }, + { + "requireAdapter": "Microsoft.Adapter/PowerShell", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/adaptedresource/manifest.json", + "kind": "resource", + "version": "0.1.0", + "type": "Microsoft.Windows.Developer/EnableLongPathSupport", + "author": "Microsoft Corporation", + "description": "The `EnableLongPathSupport` DSC resource is used to enable or disable Windows long path support.", + "capabilities": ["get", "test", "set"], + "schema": { + "embedded": { + "type": "object", + "required": ["SID"], + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "SID": { + "type": "string", + "title": "SID", + "description": "The security identifier. This is a key property and should not be set manually." + }, + "Ensure": { + "type": "string", + "enum": ["Absent", "Present"], + "title": "Ensure", + "description": "Specifies whether long path support should be enabled (`Present`) or disabled (`Absent`).\r\n Defaults to `Present`." + } + }, + "description": "The `EnableLongPathSupport` DSC resource is used to enable or disable Windows long path support.", + "title": "Microsoft.Windows.Developer/EnableLongPathSupport" + } + }, + "path": "Microsoft.Windows.Developer.psd1" + }, + { + "requireAdapter": "Microsoft.Adapter/PowerShell", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/adaptedresource/manifest.json", + "kind": "resource", + "version": "0.1.0", + "type": "Microsoft.Windows.Developer/PowerPlanSetting", + "author": "Microsoft Corporation", + "description": "The `PowerPlanSetting` DSC resource is used to manage Windows power plan settings.", + "capabilities": ["get", "test", "set"], + "schema": { + "embedded": { + "type": "object", + "required": ["Name", "PowerSource", "SettingValue"], + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "Name": { + "type": "string", + "enum": ["DisplayTimeout", "SleepTimeout"], + "title": "Name", + "description": "The name of the power plan setting to configure. Accepted values are `DisplayTimeout`\r\n or `SleepTimeout`. This is a key and mandatory property." + }, + "PowerSource": { + "type": "string", + "enum": ["PluggedIn", "Battery", "All"], + "title": "PowerSource", + "description": "The power source for the setting. Accepted values are `PluggedIn`, `Battery`, or `All`.\r\n This is a mandatory property." + }, + "SettingValue": { + "type": "integer", + "title": "SettingValue", + "description": "The timeout value in seconds. This is a mandatory property." + }, + "PluggedInValue": { + "type": "integer", + "title": "PluggedInValue", + "readOnly": true, + "description": "A read-only property indicating the current plugged-in timeout value. This property is not configurable." + }, + "BatteryValue": { + "type": "integer", + "title": "BatteryValue", + "readOnly": true, + "description": "A read-only property indicating the current battery timeout value. This property is not configurable." + } + }, + "description": "The `PowerPlanSetting` DSC resource is used to manage Windows power plan settings.", + "title": "Microsoft.Windows.Developer/PowerPlanSetting" + } + }, + "path": "Microsoft.Windows.Developer.psd1" + }, + { + "requireAdapter": "Microsoft.Adapter/PowerShell", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/adaptedresource/manifest.json", + "kind": "resource", + "version": "0.1.0", + "type": "Microsoft.Windows.Developer/WindowsCapability", + "author": "Microsoft Corporation", + "description": "The `WindowsCapability` DSC resource is used to install or remove Windows optional features.", + "capabilities": ["get", "test", "set"], + "schema": { + "embedded": { + "type": "object", + "required": ["Name"], + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "Name": { + "type": "string", + "title": "Name", + "description": "The name of the Windows capability to manage. This is a key and mandatory property." + }, + "Ensure": { + "type": "string", + "enum": ["Absent", "Present"], + "title": "Ensure", + "description": "Specifies whether the capability should be installed (`Present`) or removed (`Absent`).\r\n Defaults to `Present`." + } + }, + "description": "The `WindowsCapability` DSC resource is used to install or remove Windows optional features.", + "title": "Microsoft.Windows.Developer/WindowsCapability" + } + }, + "path": "Microsoft.Windows.Developer.psd1" + }, + { + "requireAdapter": "Microsoft.Adapter/PowerShell", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/adaptedresource/manifest.json", + "kind": "resource", + "version": "0.1.0", + "type": "Microsoft.Windows.Developer/NetConnectionProfile", + "author": "Microsoft Corporation", + "description": "The `NetConnectionProfile` DSC resource is used to manage the network connection profile for a network adapter.", + "capabilities": ["get", "test", "set"], + "schema": { + "embedded": { + "type": "object", + "required": ["SID", "InterfaceAlias", "NetworkCategory"], + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "SID": { + "type": "string", + "title": "SID", + "description": "The security identifier. This is a key property and should not be set manually." + }, + "InterfaceAlias": { + "type": "string", + "title": "InterfaceAlias", + "description": "The alias of the network interface to configure. This is a mandatory property." + }, + "NetworkCategory": { + "type": "string", + "title": "NetworkCategory", + "description": "The network category to assign. Accepted values are `Public`, `Private`, or `DomainAuthenticated`.\r\n This is a mandatory property." + } + }, + "description": "The `NetConnectionProfile` DSC resource is used to manage the network connection profile for a network adapter.", + "title": "Microsoft.Windows.Developer/NetConnectionProfile" + } + }, + "path": "Microsoft.Windows.Developer.psd1" + }, + { + "requireAdapter": "Microsoft.Adapter/PowerShell", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/adaptedresource/manifest.json", + "kind": "resource", + "version": "0.1.0", + "type": "Microsoft.Windows.Developer/AdvancedNetworkSharingSetting", + "author": "Microsoft Corporation", + "description": "The `AdvancedNetworkSharingSetting` DSC resource is used to manage Windows advanced network sharing settings.", + "capabilities": ["get", "test", "set"], + "schema": { + "embedded": { + "type": "object", + "required": ["Name"], + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "Name": { + "type": "string", + "enum": ["NetworkDiscovery", "FileAndPrinterSharing"], + "title": "Name", + "description": "The advanced sharing setting to configure. Accepted values are `NetworkDiscovery`\r\n or `FileAndPrinterSharing`. This is a key and mandatory property." + }, + "Profiles": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Profiles", + "description": "The network profiles for which the setting should be enabled (e.g., `Domain`, `Private`, `Public`)." + }, + "EnabledProfiles": { + "items": { + "type": "string" + }, + "type": "array", + "title": "EnabledProfiles", + "readOnly": true, + "description": "A read-only property listing the profiles for which the setting is currently enabled.\r\n This property is not configurable." + } + }, + "description": "The `AdvancedNetworkSharingSetting` DSC resource is used to manage Windows advanced network sharing settings.", + "title": "Microsoft.Windows.Developer/AdvancedNetworkSharingSetting" + } + }, + "path": "Microsoft.Windows.Developer.psd1" + }, + { + "requireAdapter": "Microsoft.Adapter/PowerShell", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/adaptedresource/manifest.json", + "kind": "resource", + "version": "0.1.0", + "type": "Microsoft.Windows.Developer/FirewallRule", + "author": "Microsoft Corporation", + "description": "The `FirewallRule` DSC resource is used to create, modify, or remove Windows Firewall rules.", + "capabilities": ["get", "test", "set"], + "schema": { + "embedded": { + "type": "object", + "required": ["Name"], + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "Name": { + "type": "string", + "title": "Name", + "description": "The unique name of the firewall rule. This is a key and mandatory property." + }, + "DisplayName": { + "type": "string", + "title": "DisplayName", + "description": "The display name of the firewall rule." + }, + "Action": { + "type": "string", + "enum": ["NotConfigured", "Allow", "Block"], + "title": "Action", + "description": "The action for the firewall rule. Accepted values are `NotConfigured`, `Allow`, or `Block`." + }, + "Description": { + "type": "string", + "title": "Description", + "description": "A description for the firewall rule." + }, + "Direction": { + "type": "string", + "enum": ["Inbound", "Outbound"], + "title": "Direction", + "description": "The direction of the firewall rule. Accepted values are `Inbound` or `Outbound`." + }, + "Enabled": { + "type": "boolean", + "title": "Enabled", + "description": "Specifies whether the firewall rule is enabled." + }, + "Ensure": { + "type": "string", + "enum": ["Absent", "Present"], + "title": "Ensure", + "description": "Specifies whether the firewall rule should be present or absent. Defaults to `Present`." + }, + "LocalPort": { + "items": { + "type": "string" + }, + "type": "array", + "title": "LocalPort", + "description": "The local ports to which the rule applies." + }, + "Profiles": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Profiles", + "description": "The network profiles to which the rule applies (e.g., `Domain`, `Private`, `Public`)." + }, + "Protocol": { + "type": "string", + "title": "Protocol", + "description": "The protocol for the firewall rule (e.g., `TCP`, `UDP`)." + } + }, + "description": "The `FirewallRule` DSC resource is used to create, modify, or remove Windows Firewall rules.", + "title": "Microsoft.Windows.Developer/FirewallRule" + } + }, + "path": "Microsoft.Windows.Developer.psd1" + } + ] +} diff --git a/resources/Microsoft.Windows.Setting.Accessibility/Microsoft.Windows.Setting.Accessibility.psm1 b/resources/Microsoft.Windows.Setting.Accessibility/Microsoft.Windows.Setting.Accessibility.psm1 index 33d88e1e..4b2a94f8 100644 --- a/resources/Microsoft.Windows.Setting.Accessibility/Microsoft.Windows.Setting.Accessibility.psm1 +++ b/resources/Microsoft.Windows.Setting.Accessibility/Microsoft.Windows.Setting.Accessibility.psm1 @@ -88,6 +88,32 @@ if ([string]::IsNullOrEmpty($env:TestRegistryPath)) { $global:AccessibilityRegistryPath = $global:MagnifierRegistryPath = $global:PointerRegistryPath = $global:ControlPanelAccessibilityRegistryPath = $global:AudioRegistryPath = $global:PersonalizationRegistryPath = $global:NTAccessibilityRegistryPath = $global:CursorIndicatorAccessibilityRegistryPath = $global:ControlPanelDesktopRegistryPath = $global:StickyKeysRegistryPath = $global:ToggleKeysRegistryPath = $global:FilterKeysRegistryPath = $global:EyeControlRegistryPath = $env:TestRegistryPath } +<# + .SYNOPSIS + The `Text` DSC resource is used to manage the Windows text size accessibility setting. + + .DESCRIPTION + The `Text` DSC resource configures the Windows text scaling factor, which controls + the size of text across the system for accessibility purposes. + + ## Requirements + + * Target machine must be running Windows. + + .PARAMETER Size + The desired text size. Accepted values are `Small`, `Medium`, `Large`, or `ExtraLarge`. + This is a key property. Defaults to `KeepCurrentValue`. + + .PARAMETER SizeValue + A read-only property indicating the current numeric text scale factor. This property is not configurable. + + .EXAMPLE + Invoke-DscResource -ModuleName Microsoft.Windows.Setting.Accessibility -Name Text -Method Set -Property @{ + Size = 'Large' + } + + This example sets the Windows text size to Large. +#> [DSCResource()] class Text { [DscProperty(Key)] [TextSize] $Size = [TextSize]::KeepCurrentValue @@ -141,6 +167,42 @@ class Text { } } +<# + .SYNOPSIS + The `Magnifier` DSC resource is used to manage Windows Magnifier accessibility settings. + + .DESCRIPTION + The `Magnifier` DSC resource configures the Windows Magnifier tool, including its + magnification level and zoom increment. + + ## Requirements + + * Target machine must be running Windows. + + .PARAMETER Magnification + The magnification preset to apply. Accepted values are `None`, `Low`, `Medium`, or `High`. + This is a key property. Defaults to `KeepCurrentValue`. + + .PARAMETER ZoomIncrement + The zoom increment percentage. This is a mandatory property. Defaults to `25`. + + .PARAMETER StartMagnify + Specifies whether to start the Magnifier application after applying settings. Defaults to `$false`. + + .PARAMETER MagnificationLevel + A read-only property indicating the current magnification level in percent. This property is not configurable. + + .PARAMETER ZoomIncrementLevel + A read-only property indicating the current zoom increment value. This property is not configurable. + + .EXAMPLE + Invoke-DscResource -ModuleName Microsoft.Windows.Setting.Accessibility -Name Magnifier -Method Set -Property @{ + Magnification = 'Medium' + ZoomIncrement = 25 + } + + This example sets the Windows Magnifier zoom to the Medium preset with 25% increments. +#> [DSCResource()] class Magnifier { [DscProperty(Key)] [MagnificationValue] $Magnification = [MagnificationValue]::KeepCurrentValue @@ -226,6 +288,32 @@ class Magnifier { } } +<# + .SYNOPSIS + The `MousePointer` DSC resource is used to manage the Windows mouse pointer size accessibility setting. + + .DESCRIPTION + The `MousePointer` DSC resource configures the size of the Windows mouse cursor + for accessibility purposes. + + ## Requirements + + * Target machine must be running Windows. + + .PARAMETER PointerSize + The desired mouse pointer size. Accepted values are `Normal`, `Medium`, `Large`, or `ExtraLarge`. + This is a key property. Defaults to `KeepCurrentValue`. + + .PARAMETER PointerSizeValue + A read-only property indicating the current pointer size value. This property is not configurable. + + .EXAMPLE + Invoke-DscResource -ModuleName Microsoft.Windows.Setting.Accessibility -Name MousePointer -Method Set -Property @{ + PointerSize = 'Large' + } + + This example sets the Windows mouse pointer size to Large. +#> [DSCResource()] class MousePointer { [DscProperty(Key)] [PointerSize] $PointerSize = [PointerSize]::KeepCurrentValue @@ -282,6 +370,39 @@ class MousePointer { } } +<# + .SYNOPSIS + The `VisualEffect` DSC resource is used to manage Windows visual accessibility settings. + + .DESCRIPTION + The `VisualEffect` DSC resource configures visual accessibility options including + always-visible scrollbars, transparency effects, and notification message duration. + + ## Requirements + + * Target machine must be running Windows. + + .PARAMETER SID + The security identifier. This is a key property and should not be set manually. + + .PARAMETER AlwaysShowScrollbars + Specifies whether scrollbars should always be visible. + + .PARAMETER TransparencyEffects + Specifies whether transparency effects are disabled (set `$true` to disable transparency). + + .PARAMETER MessageDurationInSeconds + The duration in seconds that notification messages are displayed. Must be between 5 and 300. + + .EXAMPLE + Invoke-DscResource -ModuleName Microsoft.Windows.Setting.Accessibility -Name VisualEffect -Method Set -Property @{ + AlwaysShowScrollbars = $true + TransparencyEffects = $false + MessageDurationInSeconds = 5 + } + + This example enables always-visible scrollbars and sets the notification duration to 5 seconds. +#> [DSCResource()] class VisualEffect { # Key required. Do not set. @@ -374,6 +495,34 @@ class VisualEffect { } } +<# + .SYNOPSIS + The `Audio` DSC resource is used to manage Windows audio accessibility settings. + + .DESCRIPTION + The `Audio` DSC resource configures the Windows mono audio accessibility setting, + which combines stereo audio into a single mono channel for users who are hard of hearing. + + ## Requirements + + * Target machine must be running Windows. + + .PARAMETER SID + The security identifier. This is a key property and should not be set manually. + + .PARAMETER EnableMonoAudio + Specifies whether mono audio should be enabled. Defaults to `$false`. + + .PARAMETER RestartService + Specifies whether to restart the Windows Audio service after applying changes. Defaults to `$false`. + + .EXAMPLE + Invoke-DscResource -ModuleName Microsoft.Windows.Setting.Accessibility -Name Audio -Method Set -Property @{ + EnableMonoAudio = $true + } + + This example enables mono audio on Windows. +#> [DSCResource()] class Audio { # Key required. Do not set. @@ -425,6 +574,41 @@ class Audio { } } +<# + .SYNOPSIS + The `TextCursor` DSC resource is used to manage Windows text cursor accessibility settings. + + .DESCRIPTION + The `TextCursor` DSC resource configures the Windows text cursor indicator, including + its visibility, size, color, and thickness. + + ## Requirements + + * Target machine must be running Windows. + + .PARAMETER SID + The security identifier. This is a key property and should not be set manually. + + .PARAMETER IndicatorStatus + Enables or disables the text cursor indicator accessibility feature. + + .PARAMETER IndicatorSize + The size of the text cursor indicator. Must be between 1 and 20. + + .PARAMETER IndicatorColor + The color of the text cursor indicator as an integer value. + + .PARAMETER Thickness + The thickness of the text cursor. Must be between 1 and 20. + + .EXAMPLE + Invoke-DscResource -ModuleName Microsoft.Windows.Setting.Accessibility -Name TextCursor -Method Set -Property @{ + IndicatorStatus = $true + Thickness = 3 + } + + This example enables the text cursor indicator and sets the cursor thickness to 3. +#> [DSCResource()] class TextCursor { # Key required. Do not set. @@ -556,6 +740,57 @@ class TextCursor { } } +<# + .SYNOPSIS + The `StickyKeys` DSC resource is used to manage the Windows Sticky Keys accessibility feature. + + .DESCRIPTION + The `StickyKeys` DSC resource configures the Sticky Keys accessibility feature, which + allows modifier keys (Shift, Ctrl, Alt) to remain active after being pressed once, enabling + users to type keyboard shortcuts one key at a time. + + ## Requirements + + * Target machine must be running Windows. + + .PARAMETER SID + The security identifier. This is a key property and should not be set manually. + + .PARAMETER Active + Specifies whether Sticky Keys is currently active. + + .PARAMETER Available + Specifies whether Sticky Keys is available to be toggled. + + .PARAMETER HotkeyActive + Specifies whether the Sticky Keys keyboard shortcut (pressing Shift 5 times) is active. + + .PARAMETER ConfirmOnHotkeyActivation + Specifies whether a confirmation dialog is shown when Sticky Keys is activated via hotkey. + + .PARAMETER HotkeySound + Specifies whether a sound plays when Sticky Keys hotkey is used. + + .PARAMETER VisualIndicator + Specifies whether a visual indicator is shown when Sticky Keys is active. + + .PARAMETER AudibleFeedback + Specifies whether an audible tone plays when a modifier key is pressed. + + .PARAMETER TriState + Specifies whether modifier keys can be locked by pressing them twice. + + .PARAMETER TwoKeysOff + Specifies whether Sticky Keys is turned off when two keys are pressed simultaneously. + + .EXAMPLE + Invoke-DscResource -ModuleName Microsoft.Windows.Setting.Accessibility -Name StickyKeys -Method Set -Property @{ + Active = $true + TwoKeysOff = $true + } + + This example enables Sticky Keys and configures it to turn off when two keys are pressed simultaneously. +#> [DSCResource()] class StickyKeys { # Key required. Do not set. @@ -688,6 +923,46 @@ class StickyKeys { } } +<# + .SYNOPSIS + The `ToggleKeys` DSC resource is used to manage the Windows Toggle Keys accessibility feature. + + .DESCRIPTION + The `ToggleKeys` DSC resource configures the Toggle Keys accessibility feature, which + plays a sound when the Caps Lock, Num Lock, or Scroll Lock keys are pressed. + + ## Requirements + + * Target machine must be running Windows. + + .PARAMETER SID + The security identifier. This is a key property and should not be set manually. + + .PARAMETER Active + Specifies whether Toggle Keys is currently active. + + .PARAMETER Available + Specifies whether Toggle Keys is available to be toggled. + + .PARAMETER HotkeyActive + Specifies whether the Toggle Keys keyboard shortcut (holding Num Lock for 5 seconds) is active. + + .PARAMETER ConfirmOnHotkeyActivation + Specifies whether a confirmation dialog is shown when Toggle Keys is activated via hotkey. + + .PARAMETER HotkeySound + Specifies whether a sound plays when Toggle Keys hotkey is used. + + .PARAMETER VisualIndicator + Specifies whether a visual indicator is shown when Toggle Keys is active. + + .EXAMPLE + Invoke-DscResource -ModuleName Microsoft.Windows.Setting.Accessibility -Name ToggleKeys -Method Set -Property @{ + Active = $true + } + + This example enables the Toggle Keys feature. +#> [DSCResource()] class ToggleKeys { # Key required. Do not set. @@ -790,6 +1065,50 @@ class ToggleKeys { } } +<# + .SYNOPSIS + The `FilterKeys` DSC resource is used to manage the Windows Filter Keys accessibility feature. + + .DESCRIPTION + The `FilterKeys` DSC resource configures the Filter Keys accessibility feature, which + ignores brief or repeated keystrokes and slows the repeat rate to help users with + hand tremors type more accurately. + + ## Requirements + + * Target machine must be running Windows. + + .PARAMETER SID + The security identifier. This is a key property and should not be set manually. + + .PARAMETER Active + Specifies whether Filter Keys is currently active. + + .PARAMETER Available + Specifies whether Filter Keys is available to be toggled. + + .PARAMETER HotkeyActive + Specifies whether the Filter Keys keyboard shortcut (holding Right Shift for 8 seconds) is active. + + .PARAMETER ConfirmOnHotkeyActivation + Specifies whether a confirmation dialog is shown when Filter Keys is activated via hotkey. + + .PARAMETER HotkeySound + Specifies whether a sound plays when Filter Keys hotkey is used. + + .PARAMETER VisualIndicator + Specifies whether a visual indicator is shown when Filter Keys is active. + + .PARAMETER AudibleFeedback + Specifies whether an audible tone plays when a key is pressed or accepted. + + .EXAMPLE + Invoke-DscResource -ModuleName Microsoft.Windows.Setting.Accessibility -Name FilterKeys -Method Set -Property @{ + Active = $true + } + + This example enables the Filter Keys feature. +#> [DSCResource()] class FilterKeys { # Key required. Do not set. @@ -902,6 +1221,29 @@ class FilterKeys { } } +<# + .SYNOPSIS + The `EyeControl` DSC resource is used to enable or disable the Windows Eye Control accessibility feature. + + .DESCRIPTION + The `EyeControl` DSC resource configures the Windows Eye Control accessibility feature, + which enables users to control Windows using only their eyes with a supported eye tracking device. + + ## Requirements + + * Target machine must be running Windows. + + .PARAMETER Ensure + Specifies whether Eye Control should be enabled (`Present`) or disabled (`Absent`). + This is a key property. + + .EXAMPLE + Invoke-DscResource -ModuleName Microsoft.Windows.Setting.Accessibility -Name EyeControl -Method Set -Property @{ + Ensure = 'Present' + } + + This example enables the Windows Eye Control accessibility feature. +#> [DscResource()] class EyeControl { [DscProperty(Key)] [Ensure] $Ensure diff --git a/resources/Microsoft.Windows.Setting.Accessibility/microsoftwindowssettingaccessibility.dsc.manifests.json b/resources/Microsoft.Windows.Setting.Accessibility/microsoftwindowssettingaccessibility.dsc.manifests.json new file mode 100644 index 00000000..fa58bae3 --- /dev/null +++ b/resources/Microsoft.Windows.Setting.Accessibility/microsoftwindowssettingaccessibility.dsc.manifests.json @@ -0,0 +1,489 @@ +{ + "adaptedResources": [ + { + "requireAdapter": "Microsoft.Adapter/PowerShell", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/adaptedresource/manifest.json", + "kind": "resource", + "version": "0.1.0", + "type": "Microsoft.Windows.Setting.Accessibility/Text", + "author": "Microsoft Corporation", + "description": "The `Text` DSC resource is used to manage the Windows text size accessibility setting.", + "capabilities": ["get", "test", "set"], + "schema": { + "embedded": { + "type": "object", + "required": ["Size"], + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "Size": { + "type": "string", + "enum": [ + "KeepCurrentValue", + "Small", + "Medium", + "Large", + "ExtraLarge" + ], + "title": "Size", + "description": "The desired text size. Accepted values are `Small`, `Medium`, `Large`, or `ExtraLarge`.\r\n This is a key property. Defaults to `KeepCurrentValue`." + }, + "SizeValue": { + "type": "integer", + "title": "SizeValue", + "readOnly": true, + "description": "A read-only property indicating the current numeric text scale factor. This property is not configurable." + } + }, + "description": "The `Text` DSC resource is used to manage the Windows text size accessibility setting.", + "title": "Microsoft.Windows.Setting.Accessibility/Text" + } + }, + "path": "Microsoft.Windows.Setting.Accessibility.psd1" + }, + { + "requireAdapter": "Microsoft.Adapter/PowerShell", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/adaptedresource/manifest.json", + "kind": "resource", + "version": "0.1.0", + "type": "Microsoft.Windows.Setting.Accessibility/Magnifier", + "author": "Microsoft Corporation", + "description": "The `Magnifier` DSC resource is used to manage Windows Magnifier accessibility settings.", + "capabilities": ["get", "test", "set"], + "schema": { + "embedded": { + "type": "object", + "required": ["Magnification", "ZoomIncrement"], + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "Magnification": { + "type": "string", + "enum": ["KeepCurrentValue", "None", "Low", "Medium", "High"], + "title": "Magnification", + "description": "The magnification preset to apply. Accepted values are `None`, `Low`, `Medium`, or `High`.\r\n This is a key property. Defaults to `KeepCurrentValue`." + }, + "ZoomIncrement": { + "type": "integer", + "title": "ZoomIncrement", + "description": "The zoom increment percentage. This is a mandatory property. Defaults to `25`." + }, + "StartMagnify": { + "type": "boolean", + "title": "StartMagnify", + "description": "Specifies whether to start the Magnifier application after applying settings. Defaults to `$false`." + }, + "MagnificationLevel": { + "type": "integer", + "title": "MagnificationLevel", + "readOnly": true, + "description": "A read-only property indicating the current magnification level in percent. This property is not configurable." + }, + "ZoomIncrementLevel": { + "type": "integer", + "title": "ZoomIncrementLevel", + "readOnly": true, + "description": "A read-only property indicating the current zoom increment value. This property is not configurable." + } + }, + "description": "The `Magnifier` DSC resource is used to manage Windows Magnifier accessibility settings.", + "title": "Microsoft.Windows.Setting.Accessibility/Magnifier" + } + }, + "path": "Microsoft.Windows.Setting.Accessibility.psd1" + }, + { + "requireAdapter": "Microsoft.Adapter/PowerShell", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/adaptedresource/manifest.json", + "kind": "resource", + "version": "0.1.0", + "type": "Microsoft.Windows.Setting.Accessibility/MousePointer", + "author": "Microsoft Corporation", + "description": "The `MousePointer` DSC resource is used to manage the Windows mouse pointer size accessibility setting.", + "capabilities": ["get", "test", "set"], + "schema": { + "embedded": { + "type": "object", + "required": ["PointerSize"], + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "PointerSize": { + "type": "string", + "enum": [ + "KeepCurrentValue", + "Normal", + "Medium", + "Large", + "ExtraLarge" + ], + "title": "PointerSize", + "description": "The desired mouse pointer size. Accepted values are `Normal`, `Medium`, `Large`, or `ExtraLarge`.\r\n This is a key property. Defaults to `KeepCurrentValue`." + }, + "PointerSizeValue": { + "type": "string", + "title": "PointerSizeValue", + "readOnly": true, + "description": "A read-only property indicating the current pointer size value. This property is not configurable." + } + }, + "description": "The `MousePointer` DSC resource is used to manage the Windows mouse pointer size accessibility setting.", + "title": "Microsoft.Windows.Setting.Accessibility/MousePointer" + } + }, + "path": "Microsoft.Windows.Setting.Accessibility.psd1" + }, + { + "requireAdapter": "Microsoft.Adapter/PowerShell", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/adaptedresource/manifest.json", + "kind": "resource", + "version": "0.1.0", + "type": "Microsoft.Windows.Setting.Accessibility/VisualEffect", + "author": "Microsoft Corporation", + "description": "The `VisualEffect` DSC resource is used to manage Windows visual accessibility settings.", + "capabilities": ["get", "test", "set"], + "schema": { + "embedded": { + "type": "object", + "required": ["SID"], + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "SID": { + "type": "string", + "title": "SID", + "description": "The security identifier. This is a key property and should not be set manually." + }, + "AlwaysShowScrollbars": { + "type": "string", + "title": "AlwaysShowScrollbars", + "description": "Specifies whether scrollbars should always be visible." + }, + "TransparencyEffects": { + "type": "string", + "title": "TransparencyEffects", + "description": "Specifies whether transparency effects are disabled (set `$true` to disable transparency)." + }, + "MessageDurationInSeconds": { + "type": "integer", + "title": "MessageDurationInSeconds", + "description": "The duration in seconds that notification messages are displayed. Must be between 5 and 300." + } + }, + "description": "The `VisualEffect` DSC resource is used to manage Windows visual accessibility settings.", + "title": "Microsoft.Windows.Setting.Accessibility/VisualEffect" + } + }, + "path": "Microsoft.Windows.Setting.Accessibility.psd1" + }, + { + "requireAdapter": "Microsoft.Adapter/PowerShell", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/adaptedresource/manifest.json", + "kind": "resource", + "version": "0.1.0", + "type": "Microsoft.Windows.Setting.Accessibility/Audio", + "author": "Microsoft Corporation", + "description": "The `Audio` DSC resource is used to manage Windows audio accessibility settings.", + "capabilities": ["get", "test", "set"], + "schema": { + "embedded": { + "type": "object", + "required": ["SID"], + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "SID": { + "type": "string", + "title": "SID", + "description": "The security identifier. This is a key property and should not be set manually." + }, + "EnableMonoAudio": { + "type": "boolean", + "title": "EnableMonoAudio", + "description": "Specifies whether mono audio should be enabled. Defaults to `$false`." + }, + "RestartService": { + "type": "boolean", + "title": "RestartService", + "description": "Specifies whether to restart the Windows Audio service after applying changes. Defaults to `$false`." + } + }, + "description": "The `Audio` DSC resource is used to manage Windows audio accessibility settings.", + "title": "Microsoft.Windows.Setting.Accessibility/Audio" + } + }, + "path": "Microsoft.Windows.Setting.Accessibility.psd1" + }, + { + "requireAdapter": "Microsoft.Adapter/PowerShell", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/adaptedresource/manifest.json", + "kind": "resource", + "version": "0.1.0", + "type": "Microsoft.Windows.Setting.Accessibility/TextCursor", + "author": "Microsoft Corporation", + "description": "The `TextCursor` DSC resource is used to manage Windows text cursor accessibility settings.", + "capabilities": ["get", "test", "set"], + "schema": { + "embedded": { + "type": "object", + "required": ["SID"], + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "SID": { + "type": "string", + "title": "SID", + "description": "The security identifier. This is a key property and should not be set manually." + }, + "IndicatorStatus": { + "type": "string", + "title": "IndicatorStatus", + "description": "Enables or disables the text cursor indicator accessibility feature." + }, + "IndicatorSize": { + "type": "integer", + "title": "IndicatorSize", + "description": "The size of the text cursor indicator. Must be between 1 and 20." + }, + "IndicatorColor": { + "type": "integer", + "title": "IndicatorColor", + "description": "The color of the text cursor indicator as an integer value." + }, + "Thickness": { + "type": "integer", + "title": "Thickness", + "description": "The thickness of the text cursor. Must be between 1 and 20." + } + }, + "description": "The `TextCursor` DSC resource is used to manage Windows text cursor accessibility settings.", + "title": "Microsoft.Windows.Setting.Accessibility/TextCursor" + } + }, + "path": "Microsoft.Windows.Setting.Accessibility.psd1" + }, + { + "requireAdapter": "Microsoft.Adapter/PowerShell", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/adaptedresource/manifest.json", + "kind": "resource", + "version": "0.1.0", + "type": "Microsoft.Windows.Setting.Accessibility/StickyKeys", + "author": "Microsoft Corporation", + "description": "The `StickyKeys` DSC resource is used to manage the Windows Sticky Keys accessibility feature.", + "capabilities": ["get", "test", "set"], + "schema": { + "embedded": { + "type": "object", + "required": ["SID"], + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "SID": { + "type": "string", + "title": "SID", + "description": "The security identifier. This is a key property and should not be set manually." + }, + "Active": { + "type": "string", + "title": "Active", + "description": "Specifies whether Sticky Keys is currently active." + }, + "Available": { + "type": "string", + "title": "Available", + "description": "Specifies whether Sticky Keys is available to be toggled." + }, + "HotkeyActive": { + "type": "string", + "title": "HotkeyActive", + "description": "Specifies whether the Sticky Keys keyboard shortcut (pressing Shift 5 times) is active." + }, + "ConfirmOnHotkeyActivation": { + "type": "string", + "title": "ConfirmOnHotkeyActivation", + "description": "Specifies whether a confirmation dialog is shown when Sticky Keys is activated via hotkey." + }, + "HotkeySound": { + "type": "string", + "title": "HotkeySound", + "description": "Specifies whether a sound plays when Sticky Keys hotkey is used." + }, + "VisualIndicator": { + "type": "string", + "title": "VisualIndicator", + "description": "Specifies whether a visual indicator is shown when Sticky Keys is active." + }, + "AudibleFeedback": { + "type": "string", + "title": "AudibleFeedback", + "description": "Specifies whether an audible tone plays when a modifier key is pressed." + }, + "TriState": { + "type": "string", + "title": "TriState", + "description": "Specifies whether modifier keys can be locked by pressing them twice." + }, + "TwoKeysOff": { + "type": "string", + "title": "TwoKeysOff", + "description": "Specifies whether Sticky Keys is turned off when two keys are pressed simultaneously." + } + }, + "description": "The `StickyKeys` DSC resource is used to manage the Windows Sticky Keys accessibility feature.", + "title": "Microsoft.Windows.Setting.Accessibility/StickyKeys" + } + }, + "path": "Microsoft.Windows.Setting.Accessibility.psd1" + }, + { + "requireAdapter": "Microsoft.Adapter/PowerShell", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/adaptedresource/manifest.json", + "kind": "resource", + "version": "0.1.0", + "type": "Microsoft.Windows.Setting.Accessibility/ToggleKeys", + "author": "Microsoft Corporation", + "description": "The `ToggleKeys` DSC resource is used to manage the Windows Toggle Keys accessibility feature.", + "capabilities": ["get", "test", "set"], + "schema": { + "embedded": { + "type": "object", + "required": ["SID"], + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "SID": { + "type": "string", + "title": "SID", + "description": "The security identifier. This is a key property and should not be set manually." + }, + "Active": { + "type": "string", + "title": "Active", + "description": "Specifies whether Toggle Keys is currently active." + }, + "Available": { + "type": "string", + "title": "Available", + "description": "Specifies whether Toggle Keys is available to be toggled." + }, + "HotkeyActive": { + "type": "string", + "title": "HotkeyActive", + "description": "Specifies whether the Toggle Keys keyboard shortcut (holding Num Lock for 5 seconds) is active." + }, + "ConfirmOnHotkeyActivation": { + "type": "string", + "title": "ConfirmOnHotkeyActivation", + "description": "Specifies whether a confirmation dialog is shown when Toggle Keys is activated via hotkey." + }, + "HotkeySound": { + "type": "string", + "title": "HotkeySound", + "description": "Specifies whether a sound plays when Toggle Keys hotkey is used." + }, + "VisualIndicator": { + "type": "string", + "title": "VisualIndicator", + "description": "Specifies whether a visual indicator is shown when Toggle Keys is active." + } + }, + "description": "The `ToggleKeys` DSC resource is used to manage the Windows Toggle Keys accessibility feature.", + "title": "Microsoft.Windows.Setting.Accessibility/ToggleKeys" + } + }, + "path": "Microsoft.Windows.Setting.Accessibility.psd1" + }, + { + "requireAdapter": "Microsoft.Adapter/PowerShell", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/adaptedresource/manifest.json", + "kind": "resource", + "version": "0.1.0", + "type": "Microsoft.Windows.Setting.Accessibility/FilterKeys", + "author": "Microsoft Corporation", + "description": "The `FilterKeys` DSC resource is used to manage the Windows Filter Keys accessibility feature.", + "capabilities": ["get", "test", "set"], + "schema": { + "embedded": { + "type": "object", + "required": ["SID"], + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "SID": { + "type": "string", + "title": "SID", + "description": "The security identifier. This is a key property and should not be set manually." + }, + "Active": { + "type": "string", + "title": "Active", + "description": "Specifies whether Filter Keys is currently active." + }, + "Available": { + "type": "string", + "title": "Available", + "description": "Specifies whether Filter Keys is available to be toggled." + }, + "HotkeyActive": { + "type": "string", + "title": "HotkeyActive", + "description": "Specifies whether the Filter Keys keyboard shortcut (holding Right Shift for 8 seconds) is active." + }, + "ConfirmOnHotkeyActivation": { + "type": "string", + "title": "ConfirmOnHotkeyActivation", + "description": "Specifies whether a confirmation dialog is shown when Filter Keys is activated via hotkey." + }, + "HotkeySound": { + "type": "string", + "title": "HotkeySound", + "description": "Specifies whether a sound plays when Filter Keys hotkey is used." + }, + "VisualIndicator": { + "type": "string", + "title": "VisualIndicator", + "description": "Specifies whether a visual indicator is shown when Filter Keys is active." + }, + "AudibleFeedback": { + "type": "string", + "title": "AudibleFeedback", + "description": "Specifies whether an audible tone plays when a key is pressed or accepted." + } + }, + "description": "The `FilterKeys` DSC resource is used to manage the Windows Filter Keys accessibility feature.", + "title": "Microsoft.Windows.Setting.Accessibility/FilterKeys" + } + }, + "path": "Microsoft.Windows.Setting.Accessibility.psd1" + }, + { + "requireAdapter": "Microsoft.Adapter/PowerShell", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/adaptedresource/manifest.json", + "kind": "resource", + "version": "0.1.0", + "type": "Microsoft.Windows.Setting.Accessibility/EyeControl", + "author": "Microsoft Corporation", + "description": "The `EyeControl` DSC resource is used to enable or disable the Windows Eye Control accessibility feature.", + "capabilities": ["get", "test", "set"], + "schema": { + "embedded": { + "type": "object", + "required": ["Ensure"], + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "Ensure": { + "type": "string", + "enum": ["Absent", "Present"], + "title": "Ensure", + "description": "Specifies whether Eye Control should be enabled (`Present`) or disabled (`Absent`).\r\n This is a key property." + } + }, + "description": "The `EyeControl` DSC resource is used to enable or disable the Windows Eye Control accessibility feature.", + "title": "Microsoft.Windows.Setting.Accessibility/EyeControl" + } + }, + "path": "Microsoft.Windows.Setting.Accessibility.psd1" + } + ] +} diff --git a/resources/Microsoft.Windows.Settings/Microsoft.Windows.Settings.psm1 b/resources/Microsoft.Windows.Settings/Microsoft.Windows.Settings.psm1 index 8d2c385b..58d7e654 100644 --- a/resources/Microsoft.Windows.Settings/Microsoft.Windows.Settings.psm1 +++ b/resources/Microsoft.Windows.Settings/Microsoft.Windows.Settings.psm1 @@ -22,6 +22,98 @@ if ([string]::IsNullOrEmpty($env:TestRegistryPath)) { $global:ExplorerRegistryPath = $global:PersonalizeRegistryPath = $global:AppModelUnlockRegistryPath = $global:TimeZoneAutoUpdateRegistryPath = $global:TimeZoneInformationRegistryPath = $global:DesktopRegistryPath = $global:DWMRegistryPath = $global:StartRegistryPath = $global:USBRegistryPath = $global:TaskbarBadgesRegistryPath = $global:TaskbarGlomLevelRegistryPath = $global:TaskbarMultiMonRegistryPath = $global:TaskbarMultiMonModeRegistryPath = $env:TestRegistryPath } +<# + .SYNOPSIS + The `WindowsSettings` DSC resource is used to manage common Windows settings. + + .DESCRIPTION + The `WindowsSettings` DSC resource configures a wide range of Windows settings + including taskbar alignment, color mode, time zone, transparency, Start menu folders, + taskbar badges, multi-monitor taskbar behavior, and USB notification settings. + + ## Requirements + + * Target machine must be running Windows. + * Some settings (DeveloperMode, TimeZone) require the resource to be run as an Administrator. + + .PARAMETER SID + The security identifier. This is a key property and should not be set manually. + + .PARAMETER TaskbarAlignment + Sets the taskbar alignment. Accepted values are `Left` or `Center`. + + .PARAMETER AppColorMode + Sets the color mode for applications. Accepted values are `Dark` or `Light`. + + .PARAMETER SystemColorMode + Sets the color mode for the Windows system UI. Accepted values are `Dark` or `Light`. + + .PARAMETER DeveloperMode + Enables or disables Developer Mode. Requires Administrator privileges. + + .PARAMETER SetTimeZoneAutomatically + Enables or disables automatic time zone detection. Requires Administrator privileges. + + .PARAMETER TimeZone + Sets the system time zone. Requires Administrator privileges. + + .PARAMETER EnableTransparency + Enables or disables transparency effects in Windows. + + .PARAMETER ShowAccentColorOnStartAndTaskbar + Enables or disables showing the accent color on the Start menu and taskbar. + + .PARAMETER ShowAccentColorOnTitleBarsAndWindowBorders + Enables or disables showing the accent color on title bars and window borders. + + .PARAMETER AutoColorization + Enables or disables automatic colorization based on the desktop background. + + .PARAMETER StartFolders + Specifies the folders to show in the Start menu. + + .PARAMETER ShowRecentList + Enables or disables the recently opened items list in the Start menu. + + .PARAMETER ShowRecommendedList + Enables or disables the recommended files list in the Start menu. + + .PARAMETER TaskbarBadges + Enables or disables taskbar button badges. + + .PARAMETER DesktopTaskbarBadges + Enables or disables taskbar button badges on the desktop taskbar. + + .PARAMETER TaskbarGroupingMode + Sets the taskbar grouping mode. Accepted values are `Always`, `WhenFull`, or `Never`. + + .PARAMETER TaskbarMultiMon + Enables or disables the taskbar on multiple monitors. + + .PARAMETER DesktopTaskbarMultiMon + Enables or disables the desktop taskbar on multiple monitors. + + .PARAMETER TaskbarMultiMonMode + Sets the multi-monitor taskbar mode. + + .PARAMETER DesktopTaskbarMultiMonMode + Sets the desktop multi-monitor taskbar mode. + + .PARAMETER NotifyOnUsbErrors + Enables or disables USB error notifications. + + .PARAMETER NotifyOnWeakCharger + Enables or disables weak charger notifications. + + .EXAMPLE + Invoke-DscResource -ModuleName Microsoft.Windows.Settings -Name WindowsSettings -Method Set -Property @{ + TaskbarAlignment = 'Left' + AppColorMode = 'Dark' + SystemColorMode = 'Dark' + } + + This example sets the taskbar to left-aligned and enables dark mode for apps and the system. +#> [DSCResource()] class WindowsSettings { # Key required. Do not set. @@ -127,7 +219,7 @@ class WindowsSettings { hidden [string] $DesktopTaskbarMultiMonModePropertyName = 'SystemSettings_DesktopTaskbar_MultiMonTaskbarMode' hidden [string] $NotifyOnUsbErrorsPropertyName = 'NotifyOnUsbErrors' hidden [string] $NotifyOnWeakChargerPropertyName = 'NotifyOnWeakCharger' - + # Start folder GUIDs hidden [hashtable] $StartFolderGuids = @{ 'Documents' = '{2D34D5CE-FA5A-4543-82F2-22E6EAF7773C}' @@ -577,11 +669,11 @@ class WindowsSettings { try { $binaryData = Get-ItemPropertyValue -Path $global:StartRegistryPath -Name $this.VisiblePlacesPropertyName $folders = [System.Collections.ArrayList]@() - + # Parse binary data to extract GUIDs $guidPattern = '([0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12})' $guidMatches = [regex]::Matches([System.Text.Encoding]::Unicode.GetString($binaryData), $guidPattern) - + foreach ($match in $guidMatches) { $guid = '{' + $match.Value.ToUpper() + '}' # Find folder name from GUID @@ -592,7 +684,7 @@ class WindowsSettings { } } } - + return [string[]]$folders.ToArray() } catch { return [string[]]@() @@ -892,4 +984,4 @@ public class NativeMethods { $timeout, [ref]$result ) -} \ No newline at end of file +} diff --git a/resources/Microsoft.Windows.Settings/microsoftwindowssettings.dsc.manifests.json b/resources/Microsoft.Windows.Settings/microsoftwindowssettings.dsc.manifests.json new file mode 100644 index 00000000..239f2e16 --- /dev/null +++ b/resources/Microsoft.Windows.Settings/microsoftwindowssettings.dsc.manifests.json @@ -0,0 +1,145 @@ +{ + "adaptedResources": [ + { + "requireAdapter": "Microsoft.Adapter/PowerShell", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/adaptedresource/manifest.json", + "kind": "resource", + "version": "0.1.0", + "type": "Microsoft.Windows.Settings/WindowsSettings", + "author": "Microsoft Corporation", + "description": "The `WindowsSettings` DSC resource is used to manage common Windows settings.", + "capabilities": ["get", "test", "set"], + "schema": { + "embedded": { + "type": "object", + "required": ["SID"], + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "SID": { + "type": "string", + "title": "SID", + "description": "The security identifier. This is a key property and should not be set manually." + }, + "TaskbarAlignment": { + "type": "string", + "title": "TaskbarAlignment", + "description": "Sets the taskbar alignment. Accepted values are `Left` or `Center`." + }, + "AppColorMode": { + "type": "string", + "title": "AppColorMode", + "description": "Sets the color mode for applications. Accepted values are `Dark` or `Light`." + }, + "SystemColorMode": { + "type": "string", + "title": "SystemColorMode", + "description": "Sets the color mode for the Windows system UI. Accepted values are `Dark` or `Light`." + }, + "DeveloperMode": { + "type": "string", + "title": "DeveloperMode", + "description": "Enables or disables Developer Mode. Requires Administrator privileges." + }, + "SetTimeZoneAutomatically": { + "type": "string", + "title": "SetTimeZoneAutomatically", + "description": "Enables or disables automatic time zone detection. Requires Administrator privileges." + }, + "TimeZone": { + "type": "string", + "title": "TimeZone", + "description": "Sets the system time zone. Requires Administrator privileges." + }, + "EnableTransparency": { + "type": "string", + "title": "EnableTransparency", + "description": "Enables or disables transparency effects in Windows." + }, + "ShowAccentColorOnStartAndTaskbar": { + "type": "string", + "title": "ShowAccentColorOnStartAndTaskbar", + "description": "Enables or disables showing the accent color on the Start menu and taskbar." + }, + "ShowAccentColorOnTitleBarsAndWindowBorders": { + "type": "string", + "title": "ShowAccentColorOnTitleBarsAndWindowBorders", + "description": "Enables or disables showing the accent color on title bars and window borders." + }, + "AutoColorization": { + "type": "string", + "title": "AutoColorization", + "description": "Enables or disables automatic colorization based on the desktop background." + }, + "StartFolders": { + "items": { + "type": "string" + }, + "type": "array", + "title": "StartFolders", + "description": "Specifies the folders to show in the Start menu." + }, + "ShowRecentList": { + "type": "string", + "title": "ShowRecentList", + "description": "Enables or disables the recently opened items list in the Start menu." + }, + "ShowRecommendedList": { + "type": "string", + "title": "ShowRecommendedList", + "description": "Enables or disables the recommended files list in the Start menu." + }, + "TaskbarBadges": { + "type": "string", + "title": "TaskbarBadges", + "description": "Enables or disables taskbar button badges." + }, + "DesktopTaskbarBadges": { + "type": "string", + "title": "DesktopTaskbarBadges", + "description": "Enables or disables taskbar button badges on the desktop taskbar." + }, + "TaskbarGroupingMode": { + "type": "string", + "title": "TaskbarGroupingMode", + "description": "Sets the taskbar grouping mode. Accepted values are `Always`, `WhenFull`, or `Never`." + }, + "TaskbarMultiMon": { + "type": "string", + "title": "TaskbarMultiMon", + "description": "Enables or disables the taskbar on multiple monitors." + }, + "DesktopTaskbarMultiMon": { + "type": "string", + "title": "DesktopTaskbarMultiMon", + "description": "Enables or disables the desktop taskbar on multiple monitors." + }, + "TaskbarMultiMonMode": { + "type": "string", + "title": "TaskbarMultiMonMode", + "description": "Sets the multi-monitor taskbar mode." + }, + "DesktopTaskbarMultiMonMode": { + "type": "string", + "title": "DesktopTaskbarMultiMonMode", + "description": "Sets the desktop multi-monitor taskbar mode." + }, + "NotifyOnUsbErrors": { + "type": "string", + "title": "NotifyOnUsbErrors", + "description": "Enables or disables USB error notifications." + }, + "NotifyOnWeakCharger": { + "type": "string", + "title": "NotifyOnWeakCharger", + "description": "Enables or disables weak charger notifications." + } + }, + "description": "The `WindowsSettings` DSC resource is used to manage common Windows settings.", + "title": "Microsoft.Windows.Settings/WindowsSettings" + } + }, + "path": "Microsoft.Windows.Settings.psd1" + } + ] +} diff --git a/resources/Microsoft.WindowsSandbox.DSC/Microsoft.WindowsSandbox.DSC.psm1 b/resources/Microsoft.WindowsSandbox.DSC/Microsoft.WindowsSandbox.DSC.psm1 index b5902d7d..06c1668d 100644 --- a/resources/Microsoft.WindowsSandbox.DSC/Microsoft.WindowsSandbox.DSC.psm1 +++ b/resources/Microsoft.WindowsSandbox.DSC/Microsoft.WindowsSandbox.DSC.psm1 @@ -12,6 +12,70 @@ if (-not(Test-Path -Path $global:WindowsSandboxExePath)) { } #region DSCResources +<# + .SYNOPSIS + The `WindowsSandbox` DSC resource is used to manage a Windows Sandbox instance. + + .DESCRIPTION + The `WindowsSandbox` DSC resource starts or stops a Windows Sandbox session. It supports + loading configuration from an existing `.wsb` file or generating a new configuration + with the specified settings. + + ## Requirements + + * Target machine must have the Windows Sandbox feature enabled. + + .PARAMETER Ensure + Specifies whether the Windows Sandbox should be running or not. This is a key property. + Defaults to `Present`. + + .PARAMETER WsbFilePath + The path to an existing `.wsb` configuration file to load. + + .PARAMETER HostFolder + The path to a host folder to map into the sandbox. + + .PARAMETER SandboxFolder + The path inside the sandbox to map the host folder to. + + .PARAMETER ReadOnly + Specifies whether the mapped folder should be read-only. + + .PARAMETER LogonCommand + A command to run when the sandbox starts. + + .PARAMETER MemoryInMB + The amount of memory in megabytes to allocate to the sandbox. + + .PARAMETER vGPU + Enables or disables virtual GPU support. + + .PARAMETER AudioInput + Enables or disables audio input in the sandbox. + + .PARAMETER ClipboardRedirection + Enables or disables clipboard sharing between host and sandbox. + + .PARAMETER Networking + Enables or disables networking in the sandbox. + + .PARAMETER PrinterRedirection + Enables or disables printer access in the sandbox. + + .PARAMETER ProtectedClient + Enables or disables protected client mode. + + .PARAMETER VideoInput + Enables or disables video input in the sandbox. + + .EXAMPLE + Invoke-DscResource -ModuleName Microsoft.WindowsSandbox.DSC -Name WindowsSandbox -Method Set -Property @{ + Ensure = 'Present' + Networking = $true + } + + This example starts a Windows Sandbox instance with networking enabled. +#> [DSCResource()] class WindowsSandbox { [DscProperty(Key)] diff --git a/resources/Microsoft.WindowsSandbox.DSC/microsoftwindowssandboxdsc.dsc.manifests.json b/resources/Microsoft.WindowsSandbox.DSC/microsoftwindowssandboxdsc.dsc.manifests.json new file mode 100644 index 00000000..81dd46fe --- /dev/null +++ b/resources/Microsoft.WindowsSandbox.DSC/microsoftwindowssandboxdsc.dsc.manifests.json @@ -0,0 +1,98 @@ +{ + "adaptedResources": [ + { + "requireAdapter": "Microsoft.Adapter/PowerShell", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/adaptedresource/manifest.json", + "kind": "resource", + "version": "0.1.0", + "type": "Microsoft.WindowsSandbox.DSC/WindowsSandbox", + "author": "DscSamples", + "description": "The `WindowsSandbox` DSC resource is used to manage a Windows Sandbox instance.", + "capabilities": ["get", "test", "set"], + "schema": { + "embedded": { + "type": "object", + "required": ["Ensure"], + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "Ensure": { + "type": "string", + "enum": ["Absent", "Present"], + "title": "Ensure", + "description": "Specifies whether the Windows Sandbox should be running or not. This is a key property.\r\n Defaults to `Present`." + }, + "WsbFilePath": { + "type": "string", + "title": "WsbFilePath", + "description": "The path to an existing `.wsb` configuration file to load." + }, + "HostFolder": { + "type": "string", + "title": "HostFolder", + "description": "The path to a host folder to map into the sandbox." + }, + "SandboxFolder": { + "type": "string", + "title": "SandboxFolder", + "description": "The path inside the sandbox to map the host folder to." + }, + "ReadOnly": { + "type": "string", + "title": "ReadOnly", + "description": "Specifies whether the mapped folder should be read-only." + }, + "LogonCommand": { + "type": "string", + "title": "LogonCommand", + "description": "A command to run when the sandbox starts." + }, + "MemoryInMB": { + "type": "string", + "title": "MemoryInMB", + "description": "The amount of memory in megabytes to allocate to the sandbox." + }, + "vGPU": { + "type": "string", + "title": "vGPU", + "description": "Enables or disables virtual GPU support." + }, + "AudioInput": { + "type": "string", + "title": "AudioInput", + "description": "Enables or disables audio input in the sandbox." + }, + "ClipboardRedirection": { + "type": "string", + "title": "ClipboardRedirection", + "description": "Enables or disables clipboard sharing between host and sandbox." + }, + "Networking": { + "type": "string", + "title": "Networking", + "description": "Enables or disables networking in the sandbox." + }, + "PrinterRedirection": { + "type": "string", + "title": "PrinterRedirection", + "description": "Enables or disables printer access in the sandbox." + }, + "ProtectedClient": { + "type": "string", + "title": "ProtectedClient", + "description": "Enables or disables protected client mode." + }, + "VideoInput": { + "type": "string", + "title": "VideoInput", + "description": "Enables or disables video input in the sandbox." + } + }, + "description": "The `WindowsSandbox` DSC resource is used to manage a Windows Sandbox instance.", + "title": "Microsoft.WindowsSandbox.DSC/WindowsSandbox" + } + }, + "path": "Microsoft.WindowsSandbox.DSC.psd1" + } + ] +} diff --git a/resources/NpmDsc/NpmDsc.psm1 b/resources/NpmDsc/NpmDsc.psm1 index a418bf66..76c297a2 100644 --- a/resources/NpmDsc/NpmDsc.psm1 +++ b/resources/NpmDsc/NpmDsc.psm1 @@ -17,14 +17,14 @@ function Invoke-Npm { [Parameter(Mandatory = $true)] [string]$Command ) - $value = Invoke-Expression -Command "npm $Command" + $value = Invoke-Expression -Command "npm $Command" - if ($LASTEXITCODE -ne 0) { - $errors = Get-NpmErrorMessages -LogPath (GetNpmPath) - throw "Command 'npm $($Command.Trim())' failed: $($errors -join '; ')" - } + if ($LASTEXITCODE -ne 0) { + $errors = Get-NpmErrorMessages -LogPath (GetNpmPath) + throw "Command 'npm $($Command.Trim())' failed: $($errors -join '; ')" + } - return $value + return $value } function Set-PackageDirectory { @@ -190,6 +190,41 @@ enum Ensure { #endRegion Enums #region DSCResources +<# + .SYNOPSIS + The `NpmInstall` DSC resource is used to install all npm packages listed in a `package.json` file. + + .DESCRIPTION + The `NpmInstall` DSC resource invokes `npm install` to install all packages defined in a + `package.json` file in the specified directory or globally. It is inherently idempotent + as npm will resolve all package dependencies on each run. + + ## Requirements + + * Target machine must have Node.js and npm installed. + + .PARAMETER SID + The security identifier. This is a key property and should not be set manually. + + .PARAMETER Ensure + Specifies whether the npm packages should be present or absent. Defaults to `Present`. + + .PARAMETER Global + Indicates whether to install packages globally. + + .PARAMETER PackageDirectory + The directory containing the `package.json` file. If not specified, the current directory is used. + + .PARAMETER Arguments + Additional arguments to pass to `npm install`. + + .EXAMPLE + Invoke-DscResource -ModuleName NpmDsc -Name NpmInstall -Method Set -Property @{ + PackageDirectory = 'C:\repos\my-project' + } + + This example installs all npm packages defined in `C:\repos\my-project\package.json`. +#> [DSCResource()] class NpmInstall { [DscProperty()] @@ -272,6 +307,9 @@ class NpmInstall { .PARAMETER Global Indicates whether the npm package should be installed globally. +.PARAMETER Arguments + Additional arguments to pass to `npm install` or `npm uninstall`. + .EXAMPLE PS C:\> Invoke-DscResource -ModuleName NpmDsc -Name NpmPackage -Method Set -Property @{ Name = 'react' } diff --git a/resources/NpmDsc/npmdsc.dsc.manifests.json b/resources/NpmDsc/npmdsc.dsc.manifests.json new file mode 100644 index 00000000..fb788b2e --- /dev/null +++ b/resources/NpmDsc/npmdsc.dsc.manifests.json @@ -0,0 +1,107 @@ +{ + "adaptedResources": [ + { + "requireAdapter": "Microsoft.Adapter/PowerShell", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/adaptedresource/manifest.json", + "kind": "resource", + "version": "0.1.0", + "type": "NpmDsc/NpmInstall", + "author": "DscSamples", + "description": "The `NpmInstall` DSC resource is used to install all npm packages listed in a `package.json` file.", + "capabilities": ["get", "test", "set"], + "schema": { + "embedded": { + "type": "object", + "required": ["SID"], + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "Ensure": { + "type": "string", + "enum": ["Absent", "Present"], + "title": "Ensure", + "description": "Specifies whether the npm packages should be present or absent. Defaults to `Present`." + }, + "SID": { + "type": "string", + "title": "SID", + "description": "The security identifier. This is a key property and should not be set manually." + }, + "Global": { + "type": "boolean", + "title": "Global", + "description": "Indicates whether to install packages globally." + }, + "PackageDirectory": { + "type": "string", + "title": "PackageDirectory", + "description": "The directory containing the `package.json` file. If not specified, the current directory is used." + }, + "Arguments": { + "type": "string", + "title": "Arguments", + "description": "Additional arguments to pass to `npm install`." + } + }, + "description": "The `NpmInstall` DSC resource is used to install all npm packages listed in a `package.json` file.", + "title": "NpmDsc/NpmInstall" + } + }, + "path": "NpmDsc.psd1" + }, + { + "requireAdapter": "Microsoft.Adapter/PowerShell", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/adaptedresource/manifest.json", + "kind": "resource", + "version": "0.1.0", + "type": "NpmDsc/NpmPackage", + "author": "DscSamples", + "description": "The `NpmPackage` DSC Resource allows you to manage the installation, update, and removal of npm packages. This resource ensures that the specified npm package is in the desired state.", + "capabilities": ["get", "test", "set", "export", "whatIf"], + "schema": { + "embedded": { + "type": "object", + "required": ["Name"], + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "Ensure": { + "type": "string", + "enum": ["Absent", "Present"], + "title": "Ensure", + "description": "Specifies whether the npm package should be present or absent. The default value is `Present`." + }, + "Name": { + "type": "string", + "title": "Name", + "description": "The name of the npm package to manage. This is a key property." + }, + "Version": { + "type": "string", + "title": "Version", + "description": "The version of the npm package to install. If not specified, the latest version will be installed." + }, + "PackageDirectory": { + "type": "string", + "title": "PackageDirectory", + "description": "The directory where the npm package should be installed. If not specified, the package will be installed in the current directory." + }, + "Global": { + "type": "boolean", + "title": "Global", + "description": "Indicates whether the npm package should be installed globally." + }, + "Arguments": { + "type": "string", + "title": "Arguments", + "description": "Additional arguments to pass to `npm install` or `npm uninstall`." + } + }, + "description": "The `NpmPackage` DSC Resource allows you to manage the installation, update, and removal of npm packages. This resource ensures that the specified npm package is in the desired state.", + "title": "NpmDsc/NpmPackage" + } + }, + "path": "NpmDsc.psd1" + } + ] +} diff --git a/resources/PythonPip3Dsc/PythonPip3Dsc.psm1 b/resources/PythonPip3Dsc/PythonPip3Dsc.psm1 index cd627440..748a702c 100644 --- a/resources/PythonPip3Dsc/PythonPip3Dsc.psm1 +++ b/resources/PythonPip3Dsc/PythonPip3Dsc.psm1 @@ -313,6 +313,9 @@ Assert-Pip3 .PARAMETER SID The security identifier. This is a key property and should not be set manually. +.PARAMETER PackageName + The name of the Python package to manage. This is a key and mandatory property. + .PARAMETER Exist Indicates whether the package should exist. Defaults to $true. diff --git a/resources/PythonPip3Dsc/pythonpip3dsc.dsc.manifests.json b/resources/PythonPip3Dsc/pythonpip3dsc.dsc.manifests.json new file mode 100644 index 00000000..6a6941b3 --- /dev/null +++ b/resources/PythonPip3Dsc/pythonpip3dsc.dsc.manifests.json @@ -0,0 +1,56 @@ +{ + "adaptedResources": [ + { + "requireAdapter": "Microsoft.Adapter/PowerShell", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/adaptedresource/manifest.json", + "kind": "resource", + "version": "0.1.0", + "type": "PythonPip3Dsc/Pip3Package", + "author": "DscSamples", + "description": "The `Pip3Package` DSC Resource allows you to install, update, and uninstall Python packages using pip3.", + "capabilities": ["get", "test", "set", "whatIf", "export"], + "schema": { + "embedded": { + "type": "object", + "required": ["PackageName"], + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "PackageName": { + "type": "string", + "title": "PackageName", + "description": "The name of the Python package to manage. This is a key and mandatory property." + }, + "Version": { + "type": "string", + "title": "Version", + "description": "The version of the Python package to manage. If not specified, the latest version will be used." + }, + "Arguments": { + "type": "string", + "title": "Arguments", + "description": "Additional arguments to pass to pip3." + }, + "Exist": { + "type": "boolean", + "title": "Exist", + "description": "Indicates whether the package should exist. Defaults to $true." + }, + "InstalledPackages": { + "items": { + "type": "object" + }, + "type": "array", + "title": "InstalledPackages", + "readOnly": true, + "description": "A list of installed packages. This property is not configurable." + } + }, + "description": "The `Pip3Package` DSC Resource allows you to install, update, and uninstall Python packages using pip3.", + "title": "PythonPip3Dsc/Pip3Package" + } + }, + "path": "PythonPip3Dsc.psd1" + } + ] +} diff --git a/resources/RustDsc/RustDsc.psm1 b/resources/RustDsc/RustDsc.psm1 index 425a90cd..5f4601c9 100644 --- a/resources/RustDsc/RustDsc.psm1 +++ b/resources/RustDsc/RustDsc.psm1 @@ -185,6 +185,9 @@ function Test-CrateInstalled { .PARAMETER Force Force overwriting existing crates or binaries. The default value is $false. +.PARAMETER InstalledVersion + A read-only property indicating the currently installed version of the crate. This property is not configurable. + .EXAMPLE PS C:\> Invoke-DscResource -ModuleName RustDsc -Name CargoToolInstall -Method Set -Property @{ CrateName = 'bat' } diff --git a/resources/RustDsc/rustdsc.dsc.manifests.json b/resources/RustDsc/rustdsc.dsc.manifests.json new file mode 100644 index 00000000..7b76f7b1 --- /dev/null +++ b/resources/RustDsc/rustdsc.dsc.manifests.json @@ -0,0 +1,61 @@ +{ + "adaptedResources": [ + { + "requireAdapter": "Microsoft.Adapter/PowerShell", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/adaptedresource/manifest.json", + "kind": "resource", + "version": "0.1.0", + "type": "RustDsc/CargoToolInstall", + "author": "DscSamples", + "description": "The `CargoToolInstall` DSC Resource allows you to manage the installation and removal of Rust crates using Cargo. This resource ensures that the specified Rust crate is in the desired state.", + "capabilities": ["get", "test", "set", "export"], + "schema": { + "embedded": { + "type": "object", + "required": ["CrateName"], + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "Exist": { + "type": "boolean", + "title": "Exist", + "description": "Specifies whether the Rust crate should exist (be installed) or not. The default value is $true." + }, + "CrateName": { + "type": "string", + "title": "CrateName", + "description": "The name of the Rust crate to manage. This is a key property." + }, + "Version": { + "type": "string", + "title": "Version", + "description": "The version of the Rust crate to install. If not specified, the latest version will be installed." + }, + "Features": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Features", + "description": "A list of features to enable when installing the crate. If not specified, all features will be enabled using --all-features." + }, + "Force": { + "type": "boolean", + "title": "Force", + "description": "Force overwriting existing crates or binaries. The default value is $false." + }, + "InstalledVersion": { + "type": "string", + "title": "InstalledVersion", + "readOnly": true, + "description": "A read-only property indicating the currently installed version of the crate. This property is not configurable." + } + }, + "description": "The `CargoToolInstall` DSC Resource allows you to manage the installation and removal of Rust crates using Cargo. This resource ensures that the specified Rust crate is in the desired state.", + "title": "RustDsc/CargoToolInstall" + } + }, + "path": "RustDsc.psd1" + } + ] +} diff --git a/resources/YarnDsc/YarnDsc.psm1 b/resources/YarnDsc/YarnDsc.psm1 index b5c35797..fea5ddf0 100644 --- a/resources/YarnDsc/YarnDsc.psm1 +++ b/resources/YarnDsc/YarnDsc.psm1 @@ -7,6 +7,38 @@ using namespace System.Collections.Generic Assert-Yarn #region DSCResources +<# + .SYNOPSIS + The `YarnInstall` DSC resource is used to install all Yarn packages listed in a `package.json` file. + + .DESCRIPTION + The `YarnInstall` DSC resource invokes `yarn install` to install all packages defined in a + `package.json` file in the specified directory. It is inherently idempotent as Yarn will + resolve all package dependencies on each run. + + ## Requirements + + * Target machine must have Yarn installed. + + .PARAMETER SID + The security identifier. This is a key property and should not be set manually. + + .PARAMETER Arguments + Additional arguments to pass to `yarn install`. + + .PARAMETER PackageDirectory + The directory containing the `package.json` file. If not specified, the current directory is used. + + .PARAMETER Dependencies + A read-only list of currently installed package dependencies. This property is not configurable. + + .EXAMPLE + Invoke-DscResource -ModuleName YarnDsc -Name YarnInstall -Method Set -Property @{ + PackageDirectory = 'C:\repos\my-project' + } + + This example installs all Yarn packages defined in `C:\repos\my-project\package.json`. +#> [DSCResource()] class YarnInstall { # DSCResource requires a key. Do not set. diff --git a/resources/YarnDsc/yarndsc.dsc.manifests.json b/resources/YarnDsc/yarndsc.dsc.manifests.json new file mode 100644 index 00000000..53b77ad9 --- /dev/null +++ b/resources/YarnDsc/yarndsc.dsc.manifests.json @@ -0,0 +1,51 @@ +{ + "adaptedResources": [ + { + "requireAdapter": "Microsoft.Adapter/PowerShell", + "$schema": "https://aka.ms/dsc/schemas/v3/bundled/adaptedresource/manifest.json", + "kind": "resource", + "version": "0.1.0", + "type": "YarnDsc/YarnInstall", + "author": "DscSamples", + "description": "The `YarnInstall` DSC resource is used to install all Yarn packages listed in a `package.json` file.", + "capabilities": ["get", "test", "set"], + "schema": { + "embedded": { + "type": "object", + "required": ["SID"], + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "SID": { + "type": "string", + "title": "SID", + "description": "The security identifier. This is a key property and should not be set manually." + }, + "Arguments": { + "type": "string", + "title": "Arguments", + "description": "Additional arguments to pass to `yarn install`." + }, + "PackageDirectory": { + "type": "string", + "title": "PackageDirectory", + "description": "The directory containing the `package.json` file. If not specified, the current directory is used." + }, + "Dependencies": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Dependencies", + "readOnly": true, + "description": "A read-only list of currently installed package dependencies. This property is not configurable." + } + }, + "description": "The `YarnInstall` DSC resource is used to install all Yarn packages listed in a `package.json` file.", + "title": "YarnDsc/YarnInstall" + } + }, + "path": "YarnDsc.psd1" + } + ] +}