mirror of
https://github.com/PowerShell/PSDscResources
synced 2026-06-21 13:45:29 +00:00
37 lines
791 B
PowerShell
37 lines
791 B
PowerShell
<#
|
|
.SYNOPSIS
|
|
Creates a group with the specified name and members or modifies the members of a group if
|
|
the named group already exists.
|
|
|
|
.PARAMETER GroupName
|
|
The name of the group to create or modify.
|
|
|
|
.PARAMETER Members
|
|
The list of members the group should have.
|
|
The default value is an empty list which will remove all members from the group.
|
|
#>
|
|
Configuration Sample_Group
|
|
{
|
|
param
|
|
(
|
|
[Parameter(Mandatory = $true)]
|
|
[ValidateNotNullOrEmpty()]
|
|
[String]
|
|
$GroupName,
|
|
|
|
[String[]]
|
|
$Members = @()
|
|
)
|
|
|
|
Import-DscResource -ModuleName 'PSDscResources'
|
|
|
|
Group Group1
|
|
{
|
|
GroupName = $GroupName
|
|
Ensure = 'Present'
|
|
Members = $Members
|
|
}
|
|
}
|
|
|
|
Sample_Group
|