mirror of
https://github.com/PowerShell/PSDscResources
synced 2026-06-21 13:45:29 +00:00
40 lines
750 B
PowerShell
40 lines
750 B
PowerShell
param
|
|
(
|
|
[Parameter(Mandatory = $true)]
|
|
[String]
|
|
$ConfigurationName
|
|
)
|
|
|
|
Configuration $ConfigurationName
|
|
{
|
|
param
|
|
(
|
|
[Parameter(Mandatory = $true)]
|
|
[ValidateNotNullOrEmpty()]
|
|
[String]
|
|
$Name,
|
|
|
|
[ValidateSet('Present', 'Absent')]
|
|
[ValidateNotNullOrEmpty()]
|
|
[String]
|
|
$Ensure = 'Present',
|
|
|
|
[Parameter(Mandatory = $true)]
|
|
[ValidateNotNullOrEmpty()]
|
|
[System.Management.Automation.PSCredential]
|
|
$Credential
|
|
)
|
|
|
|
Import-DscResource -ModuleName 'PSDscResources'
|
|
|
|
Node localhost
|
|
{
|
|
Service Service1
|
|
{
|
|
Name = $Name
|
|
Ensure = $Ensure
|
|
Credential = $Credential
|
|
}
|
|
}
|
|
}
|