Skip to content

Commit fb2132a

Browse files
Add logging to nuget.versioning loading
1 parent 4c1e59f commit fb2132a

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/dsc/psresourceget.ps1

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,19 @@ function SatisfiesVersion {
233233
ForEach-Object { $_.Assemblies } |
234234
Where-Object { $_.GetName().Name -eq 'NuGet.Versioning' }
235235

236+
Write-Verbose -Verbose "checking if NuGet.Versioning is already loaded: $loaded"
237+
236238
if (-not $loaded) {
239+
$nugetVersioningPath = Join-Path -Path $PSScriptRoot -ChildPath 'dependencies/NuGet.Versioning.dll'
240+
241+
if (-not (Test-Path -Path $nugetVersioningPath)) {
242+
Write-Trace -message "NuGet.Versioning.dll not found at expected path: $nugetVersioningPath" -level error
243+
return $false
244+
}
245+
246+
Write-Verbose -Verbose "Loading NuGet.Versioning assembly from $PSScriptRoot/dependencies/NuGet.Versioning.dll"
237247
Add-Type -Path "$PSScriptRoot/dependencies/NuGet.Versioning.dll"
248+
238249
}
239250

240251
try {

0 commit comments

Comments
 (0)