Skip to content

Commit

Permalink
Add debug messages
Browse files Browse the repository at this point in the history
  • Loading branch information
johlju committed Feb 18, 2024
1 parent 236411e commit 648ae2c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions source/Classes/020.BootstrapPSResourceGet.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ class BootstrapPSResourceGet : ResourceBase
#>
hidden [System.Collections.Hashtable] GetCurrentState([System.Collections.Hashtable] $keyProperty)
{
Write-Debug -Message "Enter GetCurrentState. Parameters:`n$($keyProperty | Out-String)"

Write-Verbose -Message $this.localizedData.EvaluateModule

$currentState = @{
Expand Down Expand Up @@ -215,6 +217,9 @@ class BootstrapPSResourceGet : ResourceBase
}
}

Write-Debug -Message 'Exit GetCurrentState'
Write-Verbose -Message 'Exit GetCurrentState' -Verbose

return $currentState
}

Expand All @@ -226,6 +231,8 @@ class BootstrapPSResourceGet : ResourceBase
#>
hidden [void] Modify([System.Collections.Hashtable] $property)
{
Write-Debug -Message "Enter Modify. Parameters:`n$($property | Out-String)"

Write-Verbose -Message $this.localizedData.Bootstrapping

if ($property.Keys -contains 'ModuleScope')
Expand All @@ -238,6 +245,8 @@ class BootstrapPSResourceGet : ResourceBase
Write-Debug -Message "Start-PSResourceGetBootstrap Parameters:`n$($property | Out-String)"

Start-PSResourceGetBootstrap @property -Force -ErrorAction 'Stop'

Write-Debug -Message 'Exit Modify'
}

<#
Expand All @@ -246,6 +255,9 @@ class BootstrapPSResourceGet : ResourceBase
#>
hidden [void] AssertProperties([System.Collections.Hashtable] $property)
{
Write-Debug -Message "Enter AssertProperties. Parameters:`n$($property | Out-String)"
Write-Verbose -Message "Enter AssertProperties. Parameters:`n$($property | Out-String)" -Verbose

# The properties ModuleScope and Destination are mutually exclusive.
$assertBoundParameterParameters = @{
BoundParameterList = $property
Expand Down Expand Up @@ -322,5 +334,7 @@ class BootstrapPSResourceGet : ResourceBase
New-InvalidArgumentException -ArgumentName 'Version' -Message $errorMessage
}
}

Write-Debug -Message 'Exit AssertProperties'
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ Describe "$($script:dscResourceName)_Integration" -Tag @('DSC') {
Verbose = $true
Force = $true
ErrorAction = 'Stop'
Debug = $true
}

Start-DscConfiguration @startDscConfigurationParameters
Expand Down

0 comments on commit 648ae2c

Please sign in to comment.