Hello, So after finding the xWinEvent resource I’m working on a composite resource to get this out. Here’s what I’ve got:
Configuration rDSCLogging
{
Param(
[Parameter(Mandatory = $true)]
[string]$Logname,
[Parameter(Mandatory = $true)]
[bool]$setstatus
)
Import-DscResource -module xWinEventLog
$loghalf = "Microsoft-Windows-WMI-Activity/"
{
xWinEventLog WMILog
{
Logname = $loghalf + $LogName
IsEnabled = $setstatus
Logmode = "Circular"
MaximumSizeInBytes = 5mb
}
}
}
and I am trying to call this resource like so in my main configuration:
Configuration SQLinstall
{
Import-DscResource -name *
Node $allnodes.where({$_.NodeRole -eq "SQL"}).NodeGuid {
rDSCLogging EnableAnalyticSQL {
Logname = "Analytic"
setstatus = $enabled }
rdsclogging EnableDebugSQL {
Logname = "Debug"
setstatus = $enabled }
}
}
Powershell is giving me this error output, likely because I am still newb to paramaters:
SQLInstall -ConfigurationData $AllServerConfigData -outpath "C:\contoso\WorkDir"
PSDesiredStateConfiguration\Node : Cannot convert value "" to type "System.Boolean". Boolean parameters accept only Boolean values and numbers, such as $True, $False, 1 or
0.
At line:95 char:5
+ Node $allnodes.where({$_.NodeRole -eq "SQL"}).NodeGuid {
+ ~~~~
+ CategoryInfo : InvalidArgument: (:) [PSDesiredStateConfiguration\node], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : InvalidCastExceptionUnsupportedParameterType,PSDesiredStateConfiguration\node
PSDesiredStateConfiguration\Node : Cannot convert value "" to type "System.Boolean". Boolean parameters accept only Boolean values and numbers, such as $True, $False, 1 or
0.
At line:95 char:5
+ Node $allnodes.where({$_.NodeRole -eq "SQL"}).NodeGuid {
+ ~~~~
+ CategoryInfo : InvalidArgument: (:) [PSDesiredStateConfiguration\node], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : InvalidCastExceptionUnsupportedParameterType,PSDesiredStateConfiguration\node
PSDesiredStateConfiguration\Node : Cannot convert value "" to type "System.Boolean". Boolean parameters accept only Boolean values and numbers, such as $True, $False, 1 or
0.
At line:95 char:5
+ Node $allnodes.where({$_.NodeRole -eq "SQL"}).NodeGuid {
+ ~~~~
+ CategoryInfo : InvalidArgument: (:) [PSDesiredStateConfiguration\node], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : InvalidCastExceptionUnsupportedParameterType,PSDesiredStateConfiguration\node
Errors occurred while processing configuration 'SQLinstall'.
At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PSDesiredStateConfiguration\PSDesiredStateConfiguration.psm1:2223 char:5
+ throw $errorRecord
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (SQLinstall:String) [], InvalidOperationException
+ FullyQualifiedErrorId : FailToProcessConfiguration
Configuration data is populated with computers from AD, and is proven to work with other configs.