Untitled
unknown
plain_text
2 years ago
827 B
6
Indexable
# Specify the path to the directory containing the .dll files
$directoryPath = "C:\temp\bin\test\"
# Get only .dll files with names starting with "dnn." or "DotNetNuke."
$dllFiles = Get-ChildItem -Path $directoryPath -Filter *.dll | Where-Object { $_.Name -match '^(dnn\.|DotNetNuke\.)' }
# Iterate through each selected .dll file and print its version information
foreach ($dllFile in $dllFiles) {
try {
# Load the assembly
$assembly = [System.Reflection.Assembly]::ReflectionOnlyLoadFrom($dllFile.FullName)
# Get the version information
$version = $assembly.GetName().Version
# Print the version information
Write-Host "$($dllFile.Name) Version: $($version.ToString())"
} catch {
Write-Host "Error loading $($dllFile.Name): $_"
}
}
Editor is loading...
Leave a Comment