Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `SharePointDSC` to `5.6.1`.
- `ConfigMgrCBDsc` to `4.0.0`.

### Fixed

- Formatting.

## [0.10.0] - 2025-07-26

### Added
Expand Down
1 change: 0 additions & 1 deletion source/CommonTasks.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,3 @@ foreach($import in @($Public + $Private))
Export-ModuleMember -Function $Public.Basename
#>

Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ configuration AddsDomainController
{
Script RemoveProtectFromAccidentalDeletionBeforeDcPromo
{
TestScript =
{
TestScript = {
try
{
Get-ADDomainController -Identity $env:ComputerName
Expand All @@ -97,8 +96,7 @@ configuration AddsDomainController
return $false
}
}
SetScript =
{
SetScript = {
Write-Verbose "Reset flag 'Protect from Accidental Deletion' from computer account '$env:ComputerName'."
Get-ADComputer $env:ComputerName | Set-ADObject -ProtectedFromAccidentalDeletion $false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ configuration AddsDomainPrincipals
{
Script "$($ExecutionName)_MemberOf"
{
TestScript =
{
TestScript = {
# get current member groups in MemberOf
$currentGroups = Get-ADPrincipalGroupMembership -Identity $using:AccountName | `
Where-Object { $using:MemberOf -contains $_.SamAccountName } | `
Expand All @@ -69,8 +68,7 @@ configuration AddsDomainPrincipals
Write-Verbose "ADPrincipal '$using:AccountName' is not member of required groups: $($missingGroups -join ', ')"
return $false
}
SetScript =
{
SetScript = {
Add-ADPrincipalGroupMembership -Identity $using:AccountName -MemberOf $using:MemberOf
}
GetScript = { return 'NA' }
Expand Down Expand Up @@ -166,8 +164,7 @@ configuration AddsDomainPrincipals

Script "$($executionName)_Computer"
{
TestScript =
{
TestScript = {
Write-Verbose "Get managed service accounts hosted by AD computer '$using:computer'..."
$result = Get-ADComputerServiceAccount -Identity $using:computer -ErrorAction SilentlyContinue | Where-Object { $_.Name -eq $using:svcAccountName }

Expand All @@ -180,8 +177,7 @@ configuration AddsDomainPrincipals
Write-Verbose "Managed service account '$using:svcAccountName' is NOT assigned to AD computer '$using:computer'."
return $false
}
SetScript =
{
SetScript = {
Write-Verbose "Assign managed service account '$using:svcAccountName' to AD computer '$using:computer'"
Add-ADComputerServiceAccount -Computer $using:computer -ServiceAccount $using:svcAccountName
}
Expand All @@ -191,7 +187,7 @@ configuration AddsDomainPrincipals
}
else
{
throw "ERROR: Only a standalone managed service account can be assigned to an AD computer account."
throw 'ERROR: Only a standalone managed service account can be assigned to an AD computer account.'
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ configuration AddsOrgUnitsAndGroups

if ($SkipDepend)
{
ADOrganizationalUnit ($ouPath -Replace '\W')
ADOrganizationalUnit ($ouPath -replace '\W')
{
Name = $Object.Name
Path = $Object.Path
Expand All @@ -69,7 +69,7 @@ configuration AddsOrgUnitsAndGroups
}
else
{
ADOrganizationalUnit ($ouPath -Replace '\W')
ADOrganizationalUnit ($ouPath -replace '\W')
{
Name = $Object.Name
Path = $Object.Path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ configuration AddsProtectFromAccidentalDeletion
SetScript = {
Get-ADUser -Filter $using:FilterUser | Set-ADObject -ProtectedFromAccidentalDeletion $true
}
GetScript = { return `@{
result = 'N/A'
}
GetScript = { return `@ {
result = 'N/A'
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion source/DSCResources/AddsTrusts/AddsTrusts.schema.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ configuration AddsTrusts
(Get-DscSplattedResource -ResourceName WaitForADDomain -ExecutionName $trust.TargetDomainName -Properties $waitFor -NoInvoke).Invoke($waitFor)

$trust['DependsOn'] = "[WaitForADDomain]$($trust.TargetDomainName)"
$executionName = "$($trust.SourceDomainName)-to-$($trust.TargetDomainName)".Replace('.','-')
$executionName = "$($trust.SourceDomainName)-to-$($trust.TargetDomainName)".Replace('.', '-')
(Get-DscSplattedResource -ResourceName ADDomainTrust -ExecutionName $executionName -Properties $trust -NoInvoke).Invoke($trust)
}
}
8 changes: 4 additions & 4 deletions source/DSCResources/AuditPolicies/AuditPolicies.schema.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ configuration AuditPolicies
{
foreach ($option in $Options)
{
$executionName = "auditPolOpt_" + ($option.Name -replace '\(|\)|\.|:| ', '')
$executionName = 'auditPolOpt_' + ($option.Name -replace '\(|\)|\.|:| ', '')
(Get-DscSplattedResource -ResourceName AuditPolicyOption -ExecutionName $executionName -Properties $option -NoInvoke).Invoke( $option )
}
}
Expand All @@ -36,7 +36,7 @@ configuration AuditPolicies
{
foreach ($subcat in $Subcategories)
{
$executionName = "auditPolSubcat_" + ($subcat.Name -replace '\(|\)|\.|:| ', '') + "_" + ($subcat.AuditFlag -replace '\(|\)|\.|:| ', '')
$executionName = 'auditPolSubcat_' + ($subcat.Name -replace '\(|\)|\.|:| ', '') + '_' + ($subcat.AuditFlag -replace '\(|\)|\.|:| ', '')
(Get-DscSplattedResource -ResourceName AuditPolicySubcategory -ExecutionName $executionName -Properties $subcat -NoInvoke).Invoke( $subcat )
}
}
Expand All @@ -45,7 +45,7 @@ configuration AuditPolicies
{
foreach ($guid in $Guids)
{
$executionName = "auditPolGuid_" + ($guid.Name -replace '\(|\)|\.|:| ', '') + "_" + ($guid.AuditFlag -replace '\(|\)|\.|:| ', '')
$executionName = 'auditPolGuid_' + ($guid.Name -replace '\(|\)|\.|:| ', '') + '_' + ($guid.AuditFlag -replace '\(|\)|\.|:| ', '')
(Get-DscSplattedResource -ResourceName AuditPolicySubcategory -ExecutionName $executionName -Properties $guid -NoInvoke).Invoke( $guid )
}
}
Expand All @@ -56,6 +56,6 @@ configuration AuditPolicies
CsvPath = $CsvPath
IsSingleInstance = 'Yes'
}
(Get-DscSplattedResource -ResourceName AuditPolicyCsv -ExecutionName "auditPolicyCsv" -Properties $auditPolicyCsv -NoInvoke).Invoke( $auditPolicyCsv )
(Get-DscSplattedResource -ResourceName AuditPolicyCsv -ExecutionName 'auditPolicyCsv' -Properties $auditPolicyCsv -NoInvoke).Invoke( $auditPolicyCsv )
}
}
4 changes: 2 additions & 2 deletions source/DSCResources/Bitlocker/Bitlocker.schema.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ configuration Bitlocker

if ($null -ne $Disks)
{
foreach ($disk in $Disks)
foreach ($disk in $Disks)
{
$disk.DependsOn = $nextDepends

Expand All @@ -73,7 +73,7 @@ configuration Bitlocker
throw "ERROR: Before using 'Bitlocker - AutoDisks' the system drive encryption must be specified in the 'Bitlocker - Disks' section."
}

foreach ($autoDisk in $AutoDisks)
foreach ($autoDisk in $AutoDisks)
{
$autoDisk.DependsOn = $nextDepends

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ configuration CertificateExports {
[Hashtable[]]
$Certificates
)

Import-DscResource -Module PSDesiredStateConfiguration
Import-DscResource -Module CertificateDsc

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ configuration ChocolateyPackages {

try
{
Write-Verbose "Loading machine Path Environment variable into session."
Write-Verbose 'Loading machine Path Environment variable into session.'
$envPath = [Environment]::GetEnvironmentVariable('Path', 'Machine')
[Environment]::SetEnvironmentVariable($envPath, 'Process')

Expand All @@ -52,7 +52,7 @@ configuration ChocolateyPackages {
$installDir = (Resolve-Path $installDir -ErrorAction Stop).Path
}

if ($chocoCmd = get-command choco.exe -CommandType Application -ErrorAction SilentlyContinue)
if ($chocoCmd = Get-Command choco.exe -CommandType Application -ErrorAction SilentlyContinue)
{
if (
!$installDir -or
Expand All @@ -72,7 +72,7 @@ configuration ChocolateyPackages {
}
else
{
Write-Verbose "Chocolatey Software not found."
Write-Verbose 'Chocolatey Software not found.'
return $false
}
}
Expand All @@ -94,7 +94,7 @@ configuration ChocolateyPackages {
$tempDir = [io.path]::Combine($Env:TEMP, 'chocolatey', 'chocInstall')
if (![System.IO.Directory]::Exists($tempDir))
{
$null = New-Item -path $tempDir -ItemType Directory
$null = New-Item -Path $tempDir -ItemType Directory
}

if ( -not (Test-Path $using:swOfflineInstallZip) )
Expand Down Expand Up @@ -122,7 +122,7 @@ configuration ChocolateyPackages {
{
try
{
$shellApplication = new-object -com shell.application
$shellApplication = New-Object -com shell.application
$zipPackage = $shellApplication.NameSpace($zipFile)
$destinationFolder = $shellApplication.NameSpace($tempDir)
$destinationFolder.CopyHere($zipPackage.Items(), 0x10)
Expand All @@ -135,7 +135,7 @@ configuration ChocolateyPackages {
}

# Call chocolatey install
Write-Verbose "Installing chocolatey on this machine."
Write-Verbose 'Installing chocolatey on this machine.'
$TempTools = [io.path]::combine($tempDir, 'tools')
# To be able to mock
$chocInstallPS1 = Join-Path $TempTools 'chocolateyInstall.ps1'
Expand Down Expand Up @@ -264,7 +264,7 @@ configuration ChocolateyPackages {
{
New-Item -Path $using:rebootKeyName -Force
}
Set-ItemProperty -Path $rebootKeyName -Name $using:rebootVarName -value 1
Set-ItemProperty -Path $rebootKeyName -Name $using:rebootVarName -Value 1
$global:DSCMachineStatus = 1
}
GetScript = { return `
Expand Down Expand Up @@ -350,7 +350,7 @@ configuration ChocolateyPackages {
{
New-Item -Path $using:rebootKeyName -Force
}
Set-ItemProperty -Path $rebootKeyName -Name $using:rebootVarName -value 1
Set-ItemProperty -Path $rebootKeyName -Name $using:rebootVarName -Value 1
$global:DSCMachineStatus = 1
}
GetScript = { return `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ configuration ChocolateyPackages2nd {
{
New-Item -Path $using:rebootKeyName -Force
}
Set-ItemProperty -Path $rebootKeyName -Name $using:rebootVarName -value 1
Set-ItemProperty -Path $rebootKeyName -Name $using:rebootVarName -Value 1
$global:DSCMachineStatus = 1
}
GetScript = { return `
Expand Down Expand Up @@ -116,7 +116,7 @@ configuration ChocolateyPackages2nd {
{
New-Item -Path $using:rebootKeyName -Force
}
Set-ItemProperty -Path $rebootKeyName -Name $using:rebootVarName -value 1
Set-ItemProperty -Path $rebootKeyName -Name $using:rebootVarName -Value 1
$global:DSCMachineStatus = 1
}
GetScript = { return `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ configuration ChocolateyPackages3rd {
{
New-Item -Path $using:rebootKeyName -Force
}
Set-ItemProperty -Path $rebootKeyName -Name $using:rebootVarName -value 1
Set-ItemProperty -Path $rebootKeyName -Name $using:rebootVarName -Value 1
$global:DSCMachineStatus = 1
}
GetScript = { return `
Expand Down Expand Up @@ -116,7 +116,7 @@ configuration ChocolateyPackages3rd {
{
New-Item -Path $using:rebootKeyName -Force
}
Set-ItemProperty -Path $rebootKeyName -Name $using:rebootVarName -value 1
Set-ItemProperty -Path $rebootKeyName -Name $using:rebootVarName -Value 1
$global:DSCMachineStatus = 1
}
GetScript = { return `
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

Configuration ConfigurationManagerDeployment
configuration ConfigurationManagerDeployment
{
[CmdletBinding()]
param
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

Configuration ConfigurationManagerDistributionGroups
configuration ConfigurationManagerDistributionGroups
{
[CmdletBinding()]
param
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ configuration DhcpScopeOptions
}

$executionName = "$($node.Name)_$($scopeOption.ScopeId)_$($scopeOption.OptionId)"
(Get-DscSplattedResource -ResourceName DhcpScopeOptionValue -ExecutionName $executionName -Properties $scopeOption -NoInvoke).Invoke($scopeOption)
(Get-DscSplattedResource -ResourceName DhcpScopeOptionValue -ExecutionName $executionName -Properties $scopeOption -NoInvoke).Invoke($scopeOption)
}
}
4 changes: 2 additions & 2 deletions source/DSCResources/DhcpServer/DhcpServer.schema.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ configuration DhcpServer

WindowsFeature DHCPServer
{
Name = 'DHCP'
Ensure = 'Present'
Name = 'DHCP'
Ensure = 'Present'
}

if ($EnableSecurityGroups -eq $true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ configuration DnsServerQueryResolutionPolicies
# FQDN ends with . -> this character is added by Add/Set function if not present in YAML FQDN definition
if ( $critType -eq 'Fqdn' -and
(($critVal -eq $using:fqdn) -or
($critVal.EndsWith('.') -and ($critVal.Substring(0, $critVal.Length - 1)) -eq $using:fqdn)) )
($critVal.EndsWith('.') -and ($critVal.Substring(0, $critVal.Length - 1)) -eq $using:fqdn)) )
{
return $true
}
}

Write-Verbose "Differences found."
Write-Verbose 'Differences found.'
return $false
}
SetScript = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ configuration DnsServerResponseRateLimiting
return $true
}

Write-Verbose "Differences found."
Write-Verbose 'Differences found.'
return $false
}
SetScript = {
Expand Down Expand Up @@ -92,7 +92,7 @@ configuration DnsServerResponseRateLimiting
}
}

Write-Verbose "Differences found."
Write-Verbose 'Differences found.'
return $false
}
SetScript = {
Expand Down
6 changes: 3 additions & 3 deletions source/DSCResources/DscDiagnostic/DscDiagnostic.schema.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function Update-DscConfiguration

function Get-DscLocalConfigurationManager
{
PSDesiredStateConfiguration\Get-DscLocalConfigurationManager
Get-DscLocalConfigurationManager
}
function Get-DscLcmControllerLog
{
Expand Down Expand Up @@ -124,7 +124,7 @@ function Start-DscConfiguration

function Get-DscOperationalEventLog
{
Get-WinEvent -LogName "Microsoft-Windows-Dsc/Operational"
Get-WinEvent -LogName 'Microsoft-Windows-Dsc/Operational'
}

function Get-DscTraceInformation
Expand Down Expand Up @@ -157,7 +157,7 @@ function Get-DscTraceInformation

#-------------------------------------------------------------------------------------------

Configuration DscDiagnostic {
configuration DscDiagnostic {

Import-DscResource -ModuleName PSDesiredStateConfiguration
Import-DscResource -ModuleName JeaDsc
Expand Down
Loading