Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
PrzemyslawKlys committed Dec 5, 2021
1 parent d3b0cde commit dffbb81
Showing 1 changed file with 42 additions and 10 deletions.
52 changes: 42 additions & 10 deletions Public/New-TeamsActivityImage.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,37 @@
function New-TeamsActivityImage {
<#
.SYNOPSIS
Adds ability to add an image to an activity within Office 365 Connector Card
.DESCRIPTION
Adds ability to add an image to an activity within Office 365 Connector Card
.PARAMETER Image
Choose one of built-in images to display. Options are: 'Add', 'Alert', 'Cancel', 'Check', 'Disable', 'Download', 'Info', 'Minus', 'Question', 'Reload', 'None'
.PARAMETER Link
Provide a link to image to display in the card.
.PARAMETER Path
Provide a path to image to display in the card. JPG and PNG files are supported.
.EXAMPLE
Send-TeamsMessage -URI $TeamsID -MessageTitle 'PSTeams - Pester Test' -MessageText "This text will show up" -Color DodgerBlue {
New-TeamsSection {
New-TeamsActivityTitle -Title "**PSTeams**"
New-TeamsActivitySubtitle -Subtitle "@PSTeams - $CurrentDate"
New-TeamsActivityImage -Image Add
New-TeamsActivityText -Text "This message proves PSTeams Pester test passed properly."
New-TeamsFact -Name 'PS Version' -Value "**$($PSVersionTable.PSVersion)**"
New-TeamsFact -Name 'PS Edition' -Value "**$($PSVersionTable.PSEdition)**"
New-TeamsFact -Name 'OS' -Value "**$($PSVersionTable.OS)**"
New-TeamsButton -Name 'Visit English Evotec Website' -Link "https://evotec.xyz"
}
} -Verbose
.NOTES
General notes
#>
[CmdletBinding(DefaultParameterSetName = 'Link')]
[alias('ActivityImageLink', 'TeamsActivityImageLink', 'New-TeamsActivityImageLink', 'ActivityImage', 'TeamsActivityImage')]
param(
Expand All @@ -7,14 +40,14 @@

[Parameter(ParameterSetName = 'Path')]
[ValidateScript({
if (-not ($_ | Test-Path)) {
throw "Path is inaccessible or does not exist"
}
if (-not ($_ | Test-Path -PathType Leaf) -or ($_ -notmatch "(\.jpg|\.png)")) {
throw "Path is not a file or file extension is not supported"
}
return $true
})]
if (-not ($_ | Test-Path)) {
throw "Path is inaccessible or does not exist"
}
if (-not ($_ | Test-Path -PathType Leaf) -or ($_ -notmatch "(\.jpg|\.png)")) {
throw "Path is not a file or file extension is not supported"
}
return $true
})]
[System.IO.FileInfo] $Path
)
if ($Path) {
Expand All @@ -25,8 +58,7 @@
ActivityImageLink = Get-Image -PathToImages $FilePath -FileName $FileBaseName -FileExtension $FileExtension -Verbose
type = 'ActivityImage'
}
}
elseif ($Image) {
} elseif ($Image) {
if ($Image -ne 'None') {
$StoredImages = [IO.Path]::Combine($PSScriptRoot, '..', 'Images')
@{
Expand Down

0 comments on commit dffbb81

Please # to comment.