EvotecIT/PSTeams

The parameter “ActivityImage” of the “New-TeamsSection” command does not work

lingyf opened this issue · 4 comments

Hello there,

I am using the latest version of the "PSTeams" module and found that the parameter "ActivityImage" of the "New-TeamsSection" command does not work. I checked the source code and found that the "StoredImages" path may not correct, here is a possible solution:

PSTeams.psm1 Line 651-654

if ($ActivityImage -ne 'None') {
-    $StoredImages = [IO.Path]::Combine("$(Split-Path -Path $PSScriptRoot -Parent)", "Images")
+    $StoredImages = [IO.Path]::Combine($PSScriptRoot, "Images")
     $ActivityImageLink = Get-Image -PathToImages $StoredImages -FileName $ActivityImage -FileExtension '.jpg' # -Verbose
}

Best Regards,
Albert

Nah, it's not related to path. I believe it's related to name of the property. It should be ActivityImage

ActivityImageLink = Get-Image -PathToImages $StoredImages -FileName $Image -FileExtension '.jpg' # -Verbose
type = 'ActivityImage'

Or maybe not. Investigating.

Changed it to: $StoredImages = [IO.Path]::Combine($PSScriptRoot, '..', 'Images') which is proper way I believe, as the ScriptRoot where the path is checked is. This is the path that is correct for "non" merged resources (before publishing). Now i need to add code to my publishing module to replace it on the fly with proper path.

Published new version