├── Private ├── ScriptBlock.RGBColors.ps1 ├── Get-DiscordConfig.ps1 ├── Initialize-DiscordConfig.ps1 └── Script.RGBColors.ps1 ├── Examples ├── Example - 2.ps1 ├── Example - 1.ps1 ├── Example - 3.ps1 └── Example - 4.ps1 ├── Public ├── New-DiscordImage.ps1 ├── New-DiscordAuthor.ps1 ├── New-DiscordFact.ps1 ├── New-DIscordSection.ps1 └── Send-DiscordMessage.ps1 ├── Docs ├── Readme.md ├── New-DiscordImage.md ├── New-DiscordFact.md ├── New-DiscordAuthor.md ├── Send-DiscordMessage.md └── New-DiscordSection.md ├── PSDiscord.Tests.ps1 ├── PSDiscord.psd1 ├── PSDiscord.AzurePipelines.yml ├── PSDiscord.psm1 ├── readme.md ├── Tests └── Send-DiscordMessage.Tests.ps1 └── Publish └── Manage-Module.ps1 /Private/ScriptBlock.RGBColors.ps1: -------------------------------------------------------------------------------- 1 | $Script:ScriptBlockColors = { 2 | param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters) 3 | $Script:RGBColors.Keys | Where-Object { $_ -like "*$wordToComplete*" } 4 | } -------------------------------------------------------------------------------- /Examples/Example - 2.ps1: -------------------------------------------------------------------------------- 1 | $DiscordUrl = '....' 2 | 3 | Send-DiscordMessage -WebHookUrl $DiscordUrl -Content 'Testing Text to Speech option' -TextToSpeech -AvatarName 'Pester Tester' -AvatarUrl "https://raw.githubusercontent.com/EvotecIT/PSTeams/master/Links/Asset%20130.png" 4 | -------------------------------------------------------------------------------- /Public/New-DiscordImage.ps1: -------------------------------------------------------------------------------- 1 | function New-DiscordImage { 2 | [alias('New-DiscordThumbnail')] 3 | [CmdletBinding()] 4 | param ( 5 | [Uri] $Url, 6 | [int] $Width, 7 | [int] $Height 8 | ) 9 | $Thumbnail = [ordered] @{ 10 | "url" = $Url 11 | "width" = $Width 12 | "height" = $Height 13 | } 14 | return $Thumbnail 15 | } -------------------------------------------------------------------------------- /Public/New-DiscordAuthor.ps1: -------------------------------------------------------------------------------- 1 | function New-DiscordAuthor { 2 | [CmdletBinding()] 3 | param ( 4 | [string] $Name, 5 | [Uri] $Url, 6 | [Uri] $IconUrl, 7 | [Uri] $ProxyUrlIcon 8 | ) 9 | $Author = [ordered] @{ 10 | name = $Name 11 | url = $Url 12 | icon_url = $IconUrl 13 | proxy_icon_url = $ProxyUrlIcon 14 | } 15 | return $Author 16 | } -------------------------------------------------------------------------------- /Public/New-DiscordFact.ps1: -------------------------------------------------------------------------------- 1 | function New-DiscordFact { 2 | [alias("New-DiscordField")] 3 | [CmdletBinding()] 4 | param ( 5 | [string] $Name, 6 | [string] $Value, 7 | [bool] $Inline 8 | ) 9 | 10 | If ($Name -ne '' -and $Value -ne '') { 11 | $Fact = [ordered] @{ 12 | name = $Name 13 | value = $Value 14 | inline = $inline 15 | } 16 | return $Fact 17 | } 18 | } -------------------------------------------------------------------------------- /Examples/Example - 1.ps1: -------------------------------------------------------------------------------- 1 | Import-Module .\PSDiscord.psd1 2 | 3 | $DiscordUrl = '' 4 | 5 | Send-DiscordMessage -WebHookUrl $DiscordUrl -Content 'My pester tests - Starting up @everyone' -AvatarName 'Pester Tester' -AvatarUrl "https://raw.githubusercontent.com/EvotecIT/PSTeams/master/Links/Asset%20130.png" 6 | Send-DiscordMessage -WebHookUrl $DiscordUrl -Content 'My pester tests - Starting up @PrzemyslawKlys' -AvatarName 'Pester Tester' -AvatarUrl "https://raw.githubusercontent.com/EvotecIT/PSTeams/master/Links/Asset%20130.png" -------------------------------------------------------------------------------- /Private/Get-DiscordConfig.ps1: -------------------------------------------------------------------------------- 1 | function Get-DiscordConfig { 2 | [CmdletBinding()] 3 | param( 4 | [string] $Name = 'Primary' 5 | ) 6 | [string] $Path = [IO.Path]::Combine($Env:USERPROFILE, '.psdiscord') 7 | [string] $PathXML = [IO.Path]::Combine($Path, "config.xml") 8 | 9 | if (Test-Path -Path $PathXML) { 10 | $Configuration = Import-Clixml -Path $PathXML 11 | if ($null -ne $Configuration.$Name) { 12 | return $Configuration.$Name 13 | } 14 | } 15 | return $null 16 | } -------------------------------------------------------------------------------- /Private/Initialize-DiscordConfig.ps1: -------------------------------------------------------------------------------- 1 | function Initialize-DiscordConfig { 2 | [CmdletBinding()] 3 | param( 4 | [string] $Name = 'Primary', 5 | [Uri] $URI 6 | ) 7 | [string] $Path = [IO.Path]::Combine($Env:USERPROFILE, '.psdiscord') 8 | [string] $PathXML = [IO.Path]::Combine($Path, "config.xml") 9 | # Creates required folder 10 | 11 | $Configuration = @{} 12 | $Configuration.$Name = $URI 13 | 14 | $null = New-Item -Path $Path -ItemType Directory -Force 15 | Export-Clixml -Path $PathXML -InputObject $Configuration -Force 16 | } -------------------------------------------------------------------------------- /Docs/Readme.md: -------------------------------------------------------------------------------- 1 | --- 2 | Module Name: PSDiscord 3 | Module Guid: d5ae39b1-56a4-4f43-b251-e402b0c3c485 4 | Download Help Link: {{Please enter FwLink manually}} 5 | Help Version: {{Please enter version of help manually (X.X.X.X) format}} 6 | Locale: en-US 7 | --- 8 | 9 | # PSDiscord Module 10 | ## Description 11 | {{Manually Enter Description Here}} 12 | 13 | ## PSDiscord Cmdlets 14 | ### [New-DiscordAuthor](New-DiscordAuthor.md) 15 | {{Fill in the Synopsis}} 16 | 17 | ### [New-DiscordFact](New-DiscordFact.md) 18 | {{Fill in the Synopsis}} 19 | 20 | ### [New-DiscordImage](New-DiscordImage.md) 21 | {{Fill in the Synopsis}} 22 | 23 | ### [New-DiscordSection](New-DiscordSection.md) 24 | {{Fill in the Synopsis}} 25 | 26 | ### [Send-DiscordMessage](Send-DiscordMessage.md) 27 | {{Fill in the Synopsis}} 28 | 29 | -------------------------------------------------------------------------------- /Examples/Example - 3.ps1: -------------------------------------------------------------------------------- 1 | $DiscordUrl = '....' 2 | 3 | $Author = New-DiscordAuthor -Name 'Pester Tester' -IconUrl "https://raw.githubusercontent.com/EvotecIT/PSTeams/master/Links/Asset%20130.png" 4 | $Fact1 = New-DiscordFact -Name '**PS Version**' -Value "$($PSVersionTable.PSVersion)" -Inline $true 5 | $Fact2 = New-DiscordFact -Name '**PS Edition**' -Value "$($PSVersionTable.PSEdition)" -Inline $true 6 | $Fact3 = New-DiscordFact -Name '**OS**' -Value "$($PSVersionTable.OS)" -Inline $true 7 | $Fact4 = New-DiscordFact -Name '**Computer Name**' -Value "$($Env:COMPUTERNAME)" -Inline $true 8 | 9 | $Thumbnail = New-DiscordThumbnail -Url "https://raw.githubusercontent.com/EvotecIT/PSTeams/master/Links/Asset%20130.png" 10 | 11 | $Section = New-DiscordSection -Title 'Everybody panic!' -Description '' -Facts $Fact1, $Fact2, $Fact3, $Fact4 -Color BlueViolet -Author $Author -Thumbnail $Thumbnail 12 | Send-DiscordMessage -WebHookUrl $DiscordUrl -Sections $Section -AvatarName 'Pester Tester' -AvatarUrl "https://raw.githubusercontent.com/EvotecIT/PSTeams/master/Links/Asset%20130.png" -Verbose -------------------------------------------------------------------------------- /Examples/Example - 4.ps1: -------------------------------------------------------------------------------- 1 | $DiscordUrl = '....' 2 | 3 | $Author = New-DiscordAuthor -Name 'Pester Tester' -IconUrl "https://raw.githubusercontent.com/EvotecIT/PSTeams/master/Links/Asset%20130.png" 4 | $Fact1 = New-DiscordFact -Name '**PS Version**' -Value "$($PSVersionTable.PSVersion)" -Inline $true 5 | $Fact2 = New-DiscordFact -Name '**PS Edition**' -Value "$($PSVersionTable.PSEdition)" -Inline $true 6 | $Fact3 = New-DiscordFact -Name '**OS**' -Value "$($PSVersionTable.OS)" -Inline $true 7 | $Fact4 = New-DiscordFact -Name '**Computer Name**' -Value "$($Env:COMPUTERNAME)" -Inline $true 8 | 9 | $Image = New-DiscordImage -Url "https://raw.githubusercontent.com/EvotecIT/PSTeams/master/Links/Asset%20130.png" 10 | 11 | $Section = New-DiscordSection -Title 'Everybody panic!' -Description '' -Facts $Fact1, $Fact2, $Fact3,$Fact4 -Color BlueViolet -Author $Author -Image $Image 12 | Send-DiscordMessage -WebHookUrl $DiscordUrl ` 13 | -Sections $Section ` 14 | -AvatarName 'Pester Tester' ` 15 | -AvatarUrl "https://raw.githubusercontent.com/EvotecIT/PSTeams/master/Links/Asset%20130.png" 16 | -------------------------------------------------------------------------------- /PSDiscord.Tests.ps1: -------------------------------------------------------------------------------- 1 | param ( 2 | $DiscordURL = $Env:DISCORDURL 3 | ) 4 | $PSVersionTable.PSVersion 5 | 6 | $ModuleName = (Get-ChildItem $PSScriptRoot\*.psd1).BaseName 7 | $ModuleVersion = (Get-Content -Raw $PSScriptRoot\*.psd1) | Invoke-Expression | ForEach-Object ModuleVersion 8 | 9 | $Pester = (Get-Module -ListAvailable pester) 10 | if ($Pester -eq $null -or ($Pester[0].Version.Major -le 4 -and $Pester[0].Version.Minor -lt 4)) { 11 | Write-Warning "$ModuleName - Downloading Pester from PSGallery" 12 | Install-Module -Name Pester -Repository PSGallery -Force -SkipPublisherCheck -Scope CurrentUser 13 | } 14 | if ((Get-Module -ListAvailable PSSharedGoods) -eq $null) { 15 | Write-Warning "$ModuleName - Downloading PSSharedGoods from PSGallery" 16 | Install-Module -Name PSSharedGoods -Repository PSGallery -Force -Scope CurrentUser 17 | } 18 | 19 | $result = Invoke-Pester -Script @{ Path = "$($PSScriptRoot)\Tests"; Parameters = @{ DiscordURL = $DiscordURL }; } -EnableExit 20 | 21 | if ($result.FailedCount -gt 0) { 22 | throw "$($result.FailedCount) tests failed." 23 | } -------------------------------------------------------------------------------- /Public/New-DIscordSection.ps1: -------------------------------------------------------------------------------- 1 | function New-DiscordSection { 2 | [alias("New-DiscordEmbed")] 3 | [CmdletBinding()] 4 | param ( 5 | [string] $Title, 6 | [string] $Description, 7 | [alias('Fields')][System.Collections.IDictionary[]] $Facts, 8 | [string] $Color, 9 | [System.Collections.IDictionary] $Author, 10 | [System.Collections.IDictionary] $Thumbnail, 11 | [System.Collections.IDictionary] $Image 12 | ) 13 | $Section = [ordered] @{ 14 | title = $Title 15 | description = $Description 16 | fields = @() 17 | } 18 | $Field = foreach ($Fact in $Facts) { 19 | if ($null -ne $Fact) { 20 | $Fact 21 | } 22 | } 23 | $Section.fields = @($Field) 24 | if ($null -ne $Color) { 25 | $Section.color = ConvertFrom-Color -Color $Color -AsDecimal 26 | } 27 | if ($null -ne $Author) { 28 | $Section.author = $Author 29 | } 30 | if ($null -ne $Image) { 31 | $Section.image = $Image 32 | } 33 | if ($null -ne $Thumbnail) { 34 | $Section.thumbnail = $Thumbnail 35 | } 36 | return $Section 37 | } 38 | Register-ArgumentCompleter -CommandName New-DiscordSection -ParameterName Color -ScriptBlock $Script:ScriptBlockColors -------------------------------------------------------------------------------- /PSDiscord.psd1: -------------------------------------------------------------------------------- 1 | @{ 2 | AliasesToExport = @('New-DiscordField', 'New-DiscordThumbnail', 'New-DiscordEmbed') 3 | Author = 'Przemyslaw Klys' 4 | CmdletsToExport = @() 5 | CompanyName = 'Evotec' 6 | CompatiblePSEditions = @('Desktop', 'Core') 7 | Copyright = '(c) 2011 - 2021 Przemyslaw Klys @ Evotec. All rights reserved.' 8 | Description = 'Simple module to send messages to Discord' 9 | FunctionsToExport = @('New-DiscordAuthor', 'New-DiscordFact', 'New-DiscordImage', 'New-DiscordSection', 'Send-DiscordMessage') 10 | GUID = 'd5ae39b1-56a4-4f43-b251-e402b0c3c485' 11 | ModuleVersion = '0.2.4' 12 | PowerShellVersion = '5.1' 13 | PrivateData = @{ 14 | PSData = @{ 15 | Tags = @('Discord', 'Messaging', 'Communication', 'Social') 16 | ProjectUri = 'https://github.com/EvotecIT/PSDiscord' 17 | IconUri = 'https://evotec.xyz/wp-content/uploads/2018/12/Discord-Logo-Color.png' 18 | } 19 | } 20 | RequiredModules = @(@{ 21 | ModuleVersion = '0.0.205' 22 | ModuleName = 'PSSharedGoods' 23 | Guid = 'ee272aa8-baaa-4edf-9f45-b6d6f7d844fe' 24 | }) 25 | RootModule = 'PSDiscord.psm1' 26 | } -------------------------------------------------------------------------------- /PSDiscord.AzurePipelines.yml: -------------------------------------------------------------------------------- 1 | jobs: 2 | - job: Build_PS_Win2016 3 | pool: 4 | vmImage: vs2017-win2016 5 | steps: 6 | - powershell: | 7 | Install-Module -Name Pester -Repository PSGallery -Force -SkipPublisherCheck 8 | .\PSDiscord.Tests.ps1 $(DiscordURL) 9 | displayName: "Run Pester Tests -PowerShell 5" 10 | 11 | - job: Build_PSCore_Ubuntu1604 12 | 13 | pool: 14 | vmImage: ubuntu-16.04 15 | 16 | steps: 17 | - script: | 18 | curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - 19 | curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft.list 20 | sudo apt-get update 21 | sudo apt-get install -y powershell 22 | displayName: "Install PowerShell Core" 23 | 24 | - script: | 25 | pwsh -c '.\PSDiscord.Tests.ps1' $(DiscordURL) 26 | displayName: "Run Pester Tests" 27 | 28 | - job: Build_PSCore_MacOS1013 29 | pool: 30 | vmImage: xcode9-macos10.13 31 | steps: 32 | - script: | 33 | brew update 34 | brew tap caskroom/cask 35 | brew install mono-libgdiplus 36 | brew cask install powershell 37 | displayName: "Install PowerShell Core" 38 | 39 | - script: | 40 | pwsh -c '.\PSDiscord.Tests.ps1' $(DiscordURL) 41 | displayName: "Run Pester Tests" 42 | -------------------------------------------------------------------------------- /Docs/New-DiscordImage.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PSDiscord-help.xml 3 | Module Name: PSDiscord 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # New-DiscordImage 9 | 10 | ## SYNOPSIS 11 | {{Fill in the Synopsis}} 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | New-DiscordImage [[-Url] ] [[-Width] ] [[-Height] ] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | {{Fill in the Description}} 21 | 22 | ## EXAMPLES 23 | 24 | ### Example 1 25 | ```powershell 26 | PS C:\> {{ Add example code here }} 27 | ``` 28 | 29 | {{ Add example description here }} 30 | 31 | ## PARAMETERS 32 | 33 | ### -Height 34 | {{Fill Height Description}} 35 | 36 | ```yaml 37 | Type: Int32 38 | Parameter Sets: (All) 39 | Aliases: 40 | 41 | Required: False 42 | Position: 2 43 | Default value: None 44 | Accept pipeline input: False 45 | Accept wildcard characters: False 46 | ``` 47 | 48 | ### -Url 49 | {{Fill Url Description}} 50 | 51 | ```yaml 52 | Type: Uri 53 | Parameter Sets: (All) 54 | Aliases: 55 | 56 | Required: False 57 | Position: 0 58 | Default value: None 59 | Accept pipeline input: False 60 | Accept wildcard characters: False 61 | ``` 62 | 63 | ### -Width 64 | {{Fill Width Description}} 65 | 66 | ```yaml 67 | Type: Int32 68 | Parameter Sets: (All) 69 | Aliases: 70 | 71 | Required: False 72 | Position: 1 73 | Default value: None 74 | Accept pipeline input: False 75 | Accept wildcard characters: False 76 | ``` 77 | 78 | ### CommonParameters 79 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 80 | 81 | ## INPUTS 82 | 83 | ### None 84 | 85 | ## OUTPUTS 86 | 87 | ### System.Object 88 | ## NOTES 89 | 90 | ## RELATED LINKS 91 | -------------------------------------------------------------------------------- /Docs/New-DiscordFact.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PSDiscord-help.xml 3 | Module Name: PSDiscord 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # New-DiscordFact 9 | 10 | ## SYNOPSIS 11 | {{Fill in the Synopsis}} 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | New-DiscordFact [[-Name] ] [[-Value] ] [[-Inline] ] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | {{Fill in the Description}} 21 | 22 | ## EXAMPLES 23 | 24 | ### Example 1 25 | ```powershell 26 | PS C:\> {{ Add example code here }} 27 | ``` 28 | 29 | {{ Add example description here }} 30 | 31 | ## PARAMETERS 32 | 33 | ### -Inline 34 | {{Fill Inline Description}} 35 | 36 | ```yaml 37 | Type: Boolean 38 | Parameter Sets: (All) 39 | Aliases: 40 | 41 | Required: False 42 | Position: 2 43 | Default value: None 44 | Accept pipeline input: False 45 | Accept wildcard characters: False 46 | ``` 47 | 48 | ### -Name 49 | {{Fill Name Description}} 50 | 51 | ```yaml 52 | Type: String 53 | Parameter Sets: (All) 54 | Aliases: 55 | 56 | Required: False 57 | Position: 0 58 | Default value: None 59 | Accept pipeline input: False 60 | Accept wildcard characters: False 61 | ``` 62 | 63 | ### -Value 64 | {{Fill Value Description}} 65 | 66 | ```yaml 67 | Type: String 68 | Parameter Sets: (All) 69 | Aliases: 70 | 71 | Required: False 72 | Position: 1 73 | Default value: None 74 | Accept pipeline input: False 75 | Accept wildcard characters: False 76 | ``` 77 | 78 | ### CommonParameters 79 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 80 | 81 | ## INPUTS 82 | 83 | ### None 84 | 85 | ## OUTPUTS 86 | 87 | ### System.Object 88 | ## NOTES 89 | 90 | ## RELATED LINKS 91 | -------------------------------------------------------------------------------- /Public/Send-DiscordMessage.ps1: -------------------------------------------------------------------------------- 1 | function Send-DiscordMessage { 2 | [CmdletBinding(SupportsShouldProcess)] 3 | param ( 4 | [alias('Url', 'Uri')][Uri] $WebHookUrl, 5 | [alias('Embeds', 'Embed', 'Section')][System.Collections.IDictionary[]] $Sections, 6 | [alias('Content', 'Message')][string] $Text, 7 | [alias('Username')] [string] $AvatarName, 8 | [Uri] $AvatarUrl, 9 | [alias('TTS')][switch] $TextToSpeech, 10 | [switch] $CreateConfig, 11 | [string] $ConfigName, 12 | [switch] $OutputJSON 13 | ) 14 | if (-not $WebHookUrl) { 15 | $WebHookUrl = Get-DiscordConfig -Name 'Primary' 16 | } 17 | if ($null -eq $WebHookUrl) { 18 | Write-Warning 'Send-DiscordMessage - WebhookUrl is not set. Either provide it as parameter or initialize it with config.' 19 | } 20 | if ($CreateConfig) { 21 | if (-not $ConfigName) { 22 | $ConfigName = 'Primary' 23 | } 24 | Initialize-DiscordConfig -ConfigName $ConfigName -URI $WebHookUrl 25 | } 26 | $FullMessage = [ordered] @{ 27 | "embeds" = @() 28 | } 29 | if ($null -ne $Sections) { 30 | foreach ($Section in $Sections) { 31 | $FullMessage.embeds += $Section 32 | } 33 | } 34 | if ($null -ne $Text) { 35 | if ($TextToSpeech) { 36 | # Applies only to Content 37 | $FullMessage.tts = $true 38 | } 39 | $FullMessage.content = $Text 40 | } 41 | if ($null -ne $AvatarName) { 42 | $FullMessage.username = $AvatarName 43 | } 44 | if ($null -ne $AvatarUrl) { 45 | $FullMessage.avatar_url = $AvatarUrl 46 | } 47 | 48 | $Body = ConvertTo-Json -Depth 6 -InputObject $FullMessage 49 | Write-Verbose -Message "Send-DiscordMessage - Body: `n$Body" 50 | if ($PSCmdlet.ShouldProcess("$([System.Environment]::NewLine)$Body", 'Invoke-RestMethod')) { 51 | Invoke-RestMethod -Uri $WebHookUrl -Body $Body -Method Post -ContentType 'application/json; charset=UTF-8' -Verbose:$false 52 | } 53 | if ($OutputJSON) { 54 | return $Body 55 | } 56 | } -------------------------------------------------------------------------------- /Docs/New-DiscordAuthor.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PSDiscord-help.xml 3 | Module Name: PSDiscord 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # New-DiscordAuthor 9 | 10 | ## SYNOPSIS 11 | {{Fill in the Synopsis}} 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | New-DiscordAuthor [[-Name] ] [[-Url] ] [[-IconUrl] ] [[-ProxyUrlIcon] ] 17 | [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | {{Fill in the Description}} 22 | 23 | ## EXAMPLES 24 | 25 | ### Example 1 26 | ```powershell 27 | PS C:\> {{ Add example code here }} 28 | ``` 29 | 30 | {{ Add example description here }} 31 | 32 | ## PARAMETERS 33 | 34 | ### -IconUrl 35 | {{Fill IconUrl Description}} 36 | 37 | ```yaml 38 | Type: Uri 39 | Parameter Sets: (All) 40 | Aliases: 41 | 42 | Required: False 43 | Position: 2 44 | Default value: None 45 | Accept pipeline input: False 46 | Accept wildcard characters: False 47 | ``` 48 | 49 | ### -Name 50 | {{Fill Name Description}} 51 | 52 | ```yaml 53 | Type: String 54 | Parameter Sets: (All) 55 | Aliases: 56 | 57 | Required: False 58 | Position: 0 59 | Default value: None 60 | Accept pipeline input: False 61 | Accept wildcard characters: False 62 | ``` 63 | 64 | ### -ProxyUrlIcon 65 | {{Fill ProxyUrlIcon Description}} 66 | 67 | ```yaml 68 | Type: Uri 69 | Parameter Sets: (All) 70 | Aliases: 71 | 72 | Required: False 73 | Position: 3 74 | Default value: None 75 | Accept pipeline input: False 76 | Accept wildcard characters: False 77 | ``` 78 | 79 | ### -Url 80 | {{Fill Url Description}} 81 | 82 | ```yaml 83 | Type: Uri 84 | Parameter Sets: (All) 85 | Aliases: 86 | 87 | Required: False 88 | Position: 1 89 | Default value: None 90 | Accept pipeline input: False 91 | Accept wildcard characters: False 92 | ``` 93 | 94 | ### CommonParameters 95 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 96 | 97 | ## INPUTS 98 | 99 | ### None 100 | 101 | ## OUTPUTS 102 | 103 | ### System.Object 104 | ## NOTES 105 | 106 | ## RELATED LINKS 107 | -------------------------------------------------------------------------------- /PSDiscord.psm1: -------------------------------------------------------------------------------- 1 | #Get public and private function definition files. 2 | $Public = @( Get-ChildItem -Path $PSScriptRoot\Public\*.ps1 -ErrorAction SilentlyContinue -Recurse ) 3 | $Private = @( Get-ChildItem -Path $PSScriptRoot\Private\*.ps1 -ErrorAction SilentlyContinue -Recurse ) 4 | 5 | $AssemblyFolders = Get-ChildItem -Path $PSScriptRoot\Lib -Directory -ErrorAction SilentlyContinue 6 | if ($AssemblyFolders.BaseName -contains 'Standard') { 7 | $Assembly = @( Get-ChildItem -Path $PSScriptRoot\Lib\Standard\*.dll -ErrorAction SilentlyContinue ) 8 | } else { 9 | if ($PSEdition -eq 'Core') { 10 | $Assembly = @( Get-ChildItem -Path $PSScriptRoot\Lib\Core\*.dll -ErrorAction SilentlyContinue ) 11 | } else { 12 | $Assembly = @( Get-ChildItem -Path $PSScriptRoot\Lib\Default\*.dll -ErrorAction SilentlyContinue ) 13 | } 14 | } 15 | $FoundErrors = @( 16 | Foreach ($Import in @($Assembly)) { 17 | try { 18 | Add-Type -Path $Import.Fullname -ErrorAction Stop 19 | } catch [System.Reflection.ReflectionTypeLoadException] { 20 | Write-Warning "Processing $($Import.Name) Exception: $($_.Exception.Message)" 21 | $LoaderExceptions = $($_.Exception.LoaderExceptions) | Sort-Object -Unique 22 | foreach ($E in $LoaderExceptions) { 23 | Write-Warning "Processing $($Import.Name) LoaderExceptions: $($E.Message)" 24 | } 25 | $true 26 | #Write-Error -Message "StackTrace: $($_.Exception.StackTrace)" 27 | } catch { 28 | Write-Warning "Processing $($Import.Name) Exception: $($_.Exception.Message)" 29 | $LoaderExceptions = $($_.Exception.LoaderExceptions) | Sort-Object -Unique 30 | foreach ($E in $LoaderExceptions) { 31 | Write-Warning "Processing $($Import.Name) LoaderExceptions: $($E.Message)" 32 | } 33 | $true 34 | #Write-Error -Message "StackTrace: $($_.Exception.StackTrace)" 35 | } 36 | } 37 | #Dot source the files 38 | Foreach ($Import in @($Private + $Public)) { 39 | Try { 40 | . $Import.Fullname 41 | } Catch { 42 | Write-Error -Message "Failed to import functions from $($import.Fullname): $_" 43 | $true 44 | } 45 | } 46 | ) 47 | 48 | if ($FoundErrors.Count -gt 0) { 49 | $ModuleName = (Get-ChildItem $PSScriptRoot\*.psd1).BaseName 50 | Write-Warning "Importing module $ModuleName failed. Fix errors before continuing." 51 | break 52 | } 53 | 54 | Export-ModuleMember -Function '*' -Alias '*' -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 |

2 | 3 | 4 | 5 | 6 |

7 | 8 |

9 | 10 | 11 | 12 | 13 |

14 | 15 |

16 | 17 | 18 | 19 |

20 | 21 | # PSDiscord - PowerShell Module 22 | 23 | [PSDiscord](https://evotec.xyz/hub/scripts/psdiscord-powershell-module/) is a **PowerShell Module** working on **Windows** / **Linux** and **Mac**. It allows to send notifications to *Discord*. It's pretty flexible and provides of easy to use cmdlets. 24 | 25 | For description and **advanced** usage visit [PSDiscord](https://evotec.xyz/hub/scripts/psdiscord-powershell-module/) dedicated page. 26 | 27 | ## Updates 28 | 29 | - 0.2.4 / 2021.06.06 30 | - Replaced [RGBColors] with [string] and defined 800+ colors in New-DiscordSection 31 | - 0.2.3 / 2021.06.01 32 | - Supports UTF8 chars/emoji 33 | - 0.0.6 / 2019.01.01 34 | - small improvements 35 | - 0.0.5 / 2018.12.30 36 | - first release 37 | 38 | ## Installing on Windows / Linux / MacOS 39 | 40 | ```powershell 41 | Install-Module PSDiscord 42 | #Install-Module PSPSDiscord -Scope CurrentUser 43 | ``` 44 | 45 | ## Updating on Windows / Linux / MacOS 46 | 47 | ```powershell 48 | Update-Module PSDiscord 49 | ``` 50 | 51 | ## Usage 52 | 53 | ```powershell 54 | $Uri = 'https://discordapp.com/api/webhooks/5083323013' 55 | 56 | $Author = New-DiscordAuthor -Name 'PSBlacklistChecker' -IconUrl "https://raw.githubusercontent.com/EvotecIT/PSDiscord/master/Links/Asset%20130.png" 57 | $Fact = New-DiscordFact -Name 'Blacklisted IP 89.74.48.97' -Value 'Found on blacklist dnsbl.sorbs.net' -Inline $false 58 | $Thumbnail = New-DiscordThumbnail -Url "https://raw.githubusercontent.com/EvotecIT/PSDiscord/master/Links/Asset%20130.png" 59 | $Section = New-DiscordSection -Title 'Everybody panic!' -Description '' -Facts $Fact, $Fact, $Fact -Color BlueViolet -Author $Author -Thumbnail $Thumbnail -Image $Thumbnail 60 | Send-DiscordMessage -WebHookUrl $Uri -Sections $Section -AvatarName 'PSBlackListChecker' -AvatarUrl "https://raw.githubusercontent.com/EvotecIT/PSDiscord/master/Links/Asset%20130.png" 61 | ``` 62 | 63 | ## How does it look like? 64 | 65 | ![image](https://evotec.xyz/wp-content/uploads/2019/01/img_5c3089ad7e553.png) 66 | -------------------------------------------------------------------------------- /Docs/Send-DiscordMessage.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PSDiscord-help.xml 3 | Module Name: PSDiscord 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Send-DiscordMessage 9 | 10 | ## SYNOPSIS 11 | {{Fill in the Synopsis}} 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Send-DiscordMessage [[-WebHookUrl] ] [[-Sections] ] [[-Text] ] 17 | [[-AvatarName] ] [[-AvatarUrl] ] [-TextToSpeech] [-CreateConfig] [[-ConfigName] ] 18 | [-OutputJSON] [-WhatIf] [-Confirm] [] 19 | ``` 20 | 21 | ## DESCRIPTION 22 | {{Fill in the Description}} 23 | 24 | ## EXAMPLES 25 | 26 | ### Example 1 27 | ```powershell 28 | PS C:\> {{ Add example code here }} 29 | ``` 30 | 31 | {{ Add example description here }} 32 | 33 | ## PARAMETERS 34 | 35 | ### -AvatarName 36 | {{Fill AvatarName Description}} 37 | 38 | ```yaml 39 | Type: String 40 | Parameter Sets: (All) 41 | Aliases: Username 42 | 43 | Required: False 44 | Position: 3 45 | Default value: None 46 | Accept pipeline input: False 47 | Accept wildcard characters: False 48 | ``` 49 | 50 | ### -AvatarUrl 51 | {{Fill AvatarUrl Description}} 52 | 53 | ```yaml 54 | Type: Uri 55 | Parameter Sets: (All) 56 | Aliases: 57 | 58 | Required: False 59 | Position: 4 60 | Default value: None 61 | Accept pipeline input: False 62 | Accept wildcard characters: False 63 | ``` 64 | 65 | ### -ConfigName 66 | {{Fill ConfigName Description}} 67 | 68 | ```yaml 69 | Type: String 70 | Parameter Sets: (All) 71 | Aliases: 72 | 73 | Required: False 74 | Position: 5 75 | Default value: None 76 | Accept pipeline input: False 77 | Accept wildcard characters: False 78 | ``` 79 | 80 | ### -Confirm 81 | Prompts you for confirmation before running the cmdlet. 82 | 83 | ```yaml 84 | Type: SwitchParameter 85 | Parameter Sets: (All) 86 | Aliases: cf 87 | 88 | Required: False 89 | Position: Named 90 | Default value: None 91 | Accept pipeline input: False 92 | Accept wildcard characters: False 93 | ``` 94 | 95 | ### -CreateConfig 96 | {{Fill CreateConfig Description}} 97 | 98 | ```yaml 99 | Type: SwitchParameter 100 | Parameter Sets: (All) 101 | Aliases: 102 | 103 | Required: False 104 | Position: Named 105 | Default value: None 106 | Accept pipeline input: False 107 | Accept wildcard characters: False 108 | ``` 109 | 110 | ### -OutputJSON 111 | {{Fill OutputJSON Description}} 112 | 113 | ```yaml 114 | Type: SwitchParameter 115 | Parameter Sets: (All) 116 | Aliases: 117 | 118 | Required: False 119 | Position: Named 120 | Default value: None 121 | Accept pipeline input: False 122 | Accept wildcard characters: False 123 | ``` 124 | 125 | ### -Sections 126 | {{Fill Sections Description}} 127 | 128 | ```yaml 129 | Type: IDictionary[] 130 | Parameter Sets: (All) 131 | Aliases: Embeds, Embed, Section 132 | 133 | Required: False 134 | Position: 1 135 | Default value: None 136 | Accept pipeline input: False 137 | Accept wildcard characters: False 138 | ``` 139 | 140 | ### -Text 141 | {{Fill Text Description}} 142 | 143 | ```yaml 144 | Type: String 145 | Parameter Sets: (All) 146 | Aliases: Content, Message 147 | 148 | Required: False 149 | Position: 2 150 | Default value: None 151 | Accept pipeline input: False 152 | Accept wildcard characters: False 153 | ``` 154 | 155 | ### -TextToSpeech 156 | {{Fill TextToSpeech Description}} 157 | 158 | ```yaml 159 | Type: SwitchParameter 160 | Parameter Sets: (All) 161 | Aliases: TTS 162 | 163 | Required: False 164 | Position: Named 165 | Default value: None 166 | Accept pipeline input: False 167 | Accept wildcard characters: False 168 | ``` 169 | 170 | ### -WebHookUrl 171 | {{Fill WebHookUrl Description}} 172 | 173 | ```yaml 174 | Type: Uri 175 | Parameter Sets: (All) 176 | Aliases: Url, Uri 177 | 178 | Required: False 179 | Position: 0 180 | Default value: None 181 | Accept pipeline input: False 182 | Accept wildcard characters: False 183 | ``` 184 | 185 | ### -WhatIf 186 | Shows what would happen if the cmdlet runs. The cmdlet is not run. 187 | 188 | ```yaml 189 | Type: SwitchParameter 190 | Parameter Sets: (All) 191 | Aliases: wi 192 | 193 | Required: False 194 | Position: Named 195 | Default value: None 196 | Accept pipeline input: False 197 | Accept wildcard characters: False 198 | ``` 199 | 200 | ### CommonParameters 201 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 202 | 203 | ## INPUTS 204 | 205 | ### None 206 | 207 | ## OUTPUTS 208 | 209 | ### System.Object 210 | ## NOTES 211 | 212 | ## RELATED LINKS 213 | -------------------------------------------------------------------------------- /Docs/New-DiscordSection.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: PSDiscord-help.xml 3 | Module Name: PSDiscord 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # New-DiscordSection 9 | 10 | ## SYNOPSIS 11 | {{Fill in the Synopsis}} 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | New-DiscordSection [[-Title] ] [[-Description] ] [[-Facts] ] 17 | [[-Color] ] [[-Author] ] [[-Thumbnail] ] [[-Image] ] 18 | [] 19 | ``` 20 | 21 | ## DESCRIPTION 22 | {{Fill in the Description}} 23 | 24 | ## EXAMPLES 25 | 26 | ### Example 1 27 | ```powershell 28 | PS C:\> {{ Add example code here }} 29 | ``` 30 | 31 | {{ Add example description here }} 32 | 33 | ## PARAMETERS 34 | 35 | ### -Author 36 | {{Fill Author Description}} 37 | 38 | ```yaml 39 | Type: IDictionary 40 | Parameter Sets: (All) 41 | Aliases: 42 | 43 | Required: False 44 | Position: 4 45 | Default value: None 46 | Accept pipeline input: False 47 | Accept wildcard characters: False 48 | ``` 49 | 50 | ### -Color 51 | {{Fill Color Description}} 52 | 53 | ```yaml 54 | Type: RGBColors 55 | Parameter Sets: (All) 56 | Aliases: 57 | Accepted values: Black, Navy, DarkBlue, MediumBlue, Blue, DarkGreen, Green, Teal, DarkCyan, DeepSkyBlue, DarkTurquoise, MediumSpringGreen, Lime, SpringGreen, Aqua, Cyan, MidnightBlue, DodgerBlue, LightSeaGreen, ForestGreen, SeaGreen, DarkSlateGray, DarkSlateGrey, LimeGreen, MediumSeaGreen, Turquoise, RoyalBlue, SteelBlue, DarkSlateBlue, MediumTurquoise, Indigo, DarkOliveGreen, CadetBlue, CornflowerBlue, MediumAquamarine, DimGray, DimGrey, SlateBlue, OliveDrab, SlateGray, SlateGrey, LightSlateGray, LightSlateGrey, MediumSlateBlue, LawnGreen, Chartreuse, Aquamarine, Maroon, Purple, Olive, Grey, Gray, SkyBlue, LightSkyBlue, BlueViolet, DarkRed, DarkMagenta, SaddleBrown, DarkSeaGreen, LightGreen, MediumPurple, DarkViolet, PaleGreen, DarkOrchid, YellowGreen, Sienna, Brown, DarkGray, DarkGrey, LightBlue, GreenYellow, PaleTurquoise, LightSteelBlue, PowderBlue, FireBrick, DarkGoldenrod, MediumOrchid, RosyBrown, DarkKhaki, Silver, MediumVioletRed, IndianRed, Peru, Chocolate, Tan, LightGray, LightGrey, Thistle, Orchid, Goldenrod, PaleVioletRed, Crimson, Gainsboro, Plum, BurlyWood, LightCyan, Lavender, DarkSalmon, Violet, PaleGoldenrod, LightCoral, Khaki, AliceBlue, Honeydew, Azure, SandyBrown, Wheat, Beige, WhiteSmoke, MintCream, GhostWhite, Salmon, AntiqueWhite, Linen, LightGoldenrodYellow, OldLace, Red, Fuchsia, Magenta, DeepPink, OrangeRed, Tomato, HotPink, Coral, DarkOrange, LightSalmon, Orange, LightPink, Pink, Gold, PeachPuff, NavajoWhite, Moccasin, Bisque, MistyRose, BlanchedAlmond, PapayaWhip, LavenderBlush, Seashell, Cornsilk, LemonChiffon, FloralWhite, Snow, Yellow, LightYellow, Ivory, White 58 | 59 | Required: False 60 | Position: 3 61 | Default value: None 62 | Accept pipeline input: False 63 | Accept wildcard characters: False 64 | ``` 65 | 66 | ### -Description 67 | {{Fill Description Description}} 68 | 69 | ```yaml 70 | Type: String 71 | Parameter Sets: (All) 72 | Aliases: 73 | 74 | Required: False 75 | Position: 1 76 | Default value: None 77 | Accept pipeline input: False 78 | Accept wildcard characters: False 79 | ``` 80 | 81 | ### -Facts 82 | {{Fill Facts Description}} 83 | 84 | ```yaml 85 | Type: IDictionary[] 86 | Parameter Sets: (All) 87 | Aliases: Fields 88 | 89 | Required: False 90 | Position: 2 91 | Default value: None 92 | Accept pipeline input: False 93 | Accept wildcard characters: False 94 | ``` 95 | 96 | ### -Image 97 | {{Fill Image Description}} 98 | 99 | ```yaml 100 | Type: IDictionary 101 | Parameter Sets: (All) 102 | Aliases: 103 | 104 | Required: False 105 | Position: 6 106 | Default value: None 107 | Accept pipeline input: False 108 | Accept wildcard characters: False 109 | ``` 110 | 111 | ### -Thumbnail 112 | {{Fill Thumbnail Description}} 113 | 114 | ```yaml 115 | Type: IDictionary 116 | Parameter Sets: (All) 117 | Aliases: 118 | 119 | Required: False 120 | Position: 5 121 | Default value: None 122 | Accept pipeline input: False 123 | Accept wildcard characters: False 124 | ``` 125 | 126 | ### -Title 127 | {{Fill Title Description}} 128 | 129 | ```yaml 130 | Type: String 131 | Parameter Sets: (All) 132 | Aliases: 133 | 134 | Required: False 135 | Position: 0 136 | Default value: None 137 | Accept pipeline input: False 138 | Accept wildcard characters: False 139 | ``` 140 | 141 | ### CommonParameters 142 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 143 | 144 | ## INPUTS 145 | 146 | ### None 147 | 148 | ## OUTPUTS 149 | 150 | ### System.Object 151 | ## NOTES 152 | 153 | ## RELATED LINKS 154 | -------------------------------------------------------------------------------- /Tests/Send-DiscordMessage.Tests.ps1: -------------------------------------------------------------------------------- 1 | param ( 2 | $DiscordUrl = $Env:DiscordUrl 3 | ) 4 | #Requires -Modules Pester 5 | Import-Module $PSScriptRoot\..\PSDiscord.psd1 -Force #-Verbose 6 | 7 | Describe 'Send-DiscordMessage - Should send messages properly' { 8 | It 'Given - url, content and avatar name with url - Should send message properly' { 9 | 10 | Send-DiscordMessage -WebHookUrl $DiscordUrl -Content 'My pester tests - Starting up' -AvatarName 'Pester Tester' -AvatarUrl "https://raw.githubusercontent.com/EvotecIT/PSTeams/master/Links/Asset%20130.png" 11 | } 12 | It 'Given - url, content and avatar name with url and Text To Speech - Should send message properly' { 13 | 14 | Send-DiscordMessage -WebHookUrl $DiscordUrl -Content 'Testing Text to Speech option' -TextToSpeech -AvatarName 'Pester Tester' -AvatarUrl "https://raw.githubusercontent.com/EvotecIT/PSTeams/master/Links/Asset%20130.png" 15 | } 16 | It 'Given - Author, Fact, Thumbnail, Section, Color - Should send message properly' { 17 | 18 | $Author = New-DiscordAuthor -Name 'Pester Tester' -IconUrl "https://raw.githubusercontent.com/EvotecIT/PSTeams/master/Links/Asset%20130.png" 19 | $Fact1 = New-DiscordFact -Name '**PS Version**' -Value "$($PSVersionTable.PSVersion)" -Inline $true 20 | $Fact2 = New-DiscordFact -Name '**PS Edition**' -Value "$($PSVersionTable.PSEdition)" -Inline $true 21 | $Fact3 = New-DiscordFact -Name '**OS**' -Value "$($PSVersionTable.OS)" -Inline $true 22 | $Fact4 = New-DiscordFact -Name '**Computer Name**' -Value "$($Env:COMPUTERNAME)" -Inline $true 23 | 24 | $Thumbnail = New-DiscordThumbnail -Url "https://raw.githubusercontent.com/EvotecIT/PSTeams/master/Links/Asset%20130.png" 25 | 26 | $Section = New-DiscordSection -Title 'Everybody panic!' -Description '' -Facts $Fact1, $Fact2, $Fact3, $Fact4 -Color BlueViolet -Author $Author -Thumbnail $Thumbnail 27 | Send-DiscordMessage -WebHookUrl $DiscordUrl -Sections $Section -AvatarName 'Pester Tester' -AvatarUrl "https://raw.githubusercontent.com/EvotecIT/PSTeams/master/Links/Asset%20130.png" -Verbose 28 | } 29 | It 'Given - Author, 3 facts, 1 image, 1 section, Avatar Name and URL - Should send message properly' { 30 | 31 | $Author = New-DiscordAuthor -Name 'Pester Tester' -IconUrl "https://raw.githubusercontent.com/EvotecIT/PSTeams/master/Links/Asset%20130.png" 32 | $Fact1 = New-DiscordFact -Name '**PS Version**' -Value "$($PSVersionTable.PSVersion)" -Inline $true 33 | $Fact2 = New-DiscordFact -Name '**PS Edition**' -Value "$($PSVersionTable.PSEdition)" -Inline $true 34 | $Fact3 = New-DiscordFact -Name '**OS**' -Value "$($PSVersionTable.OS)" -Inline $true 35 | $Fact4 = New-DiscordFact -Name '**Computer Name**' -Value "$($Env:COMPUTERNAME)" -Inline $true 36 | 37 | $Image = New-DiscordImage -Url "https://raw.githubusercontent.com/EvotecIT/PSTeams/master/Links/Asset%20130.png" 38 | 39 | $Section = New-DiscordSection -Title 'Everybody panic!' -Description '' -Facts $Fact1, $Fact2, $Fact3, $Fact4 -Color BlueViolet -Author $Author -Image $Image 40 | Send-DiscordMessage -WebHookUrl $DiscordUrl ` 41 | -Sections $Section ` 42 | -AvatarName 'Pester Tester' ` 43 | -AvatarUrl "https://raw.githubusercontent.com/EvotecIT/PSTeams/master/Links/Asset%20130.png" 44 | 45 | } 46 | It 'Given - Just 1 Author, 1 Fact, 1 Thumbnail, 1 Section, 1 Color - Should send message properly' { 47 | 48 | $Author = New-DiscordAuthor -Name 'Pester Tester' -IconUrl "https://raw.githubusercontent.com/EvotecIT/PSTeams/master/Links/Asset%20130.png" 49 | $Fact1 = New-DiscordFact -Name '**PS Version**' -Value "$($PSVersionTable.PSVersion)" -Inline $true 50 | 51 | $Thumbnail = New-DiscordThumbnail -Url "https://raw.githubusercontent.com/EvotecIT/PSTeams/master/Links/Asset%20130.png" 52 | 53 | $Section = New-DiscordSection -Title 'Everybody panic!' -Description '' -Facts $Fact1 -Color BlueViolet -Author $Author -Thumbnail $Thumbnail 54 | Send-DiscordMessage -WebHookUrl $DiscordUrl -Sections $Section -AvatarName 'Pester Tester' -AvatarUrl "https://raw.githubusercontent.com/EvotecIT/PSTeams/master/Links/Asset%20130.png" -Verbose 55 | } 56 | } 57 | Describe 'Send-DiscordMessage - Invoke-RestMethod Test' { 58 | It 'Given basic data, things should be delivered to Discord' { 59 | # Discord message/notification configuration 60 | $Uri = $DiscordUrl 61 | $Author = New-DiscordAuthor -Name 'Name' -IconUrl "https://raw.githubusercontent.com/EvotecIT/PSTeams/master/Links/Asset%20130.png" 62 | $Fact = New-DiscordFact -Name 'Test' -Value 'message' -Inline $false 63 | $Thumbnail = New-DiscordThumbnail -Url "https://raw.githubusercontent.com/EvotecIT/PSTeams/master/Links/Asset%20130.png" 64 | $Section = New-DiscordSection -Title 'message' -Description '' -Facts $Fact -Color Red -Author $Author -Thumbnail $Thumbnail -Image $Thumbnail 65 | Send-DiscordMessage -WebHookUrl $Uri -Sections $Section -AvatarName 'NoPixelChecker' -AvatarUrl "https://raw.githubusercontent.com/EvotecIT/PSTeams/master/Links/Asset%20130.png" 66 | } 67 | } -------------------------------------------------------------------------------- /Publish/Manage-Module.ps1: -------------------------------------------------------------------------------- 1 | Clear-Host 2 | Import-Module "C:\Support\GitHub\PSPublishModule\PSPublishModule.psm1" -Force 3 | 4 | $Configuration = @{ 5 | Information = @{ 6 | ModuleName = 'PSDiscord' 7 | 8 | DirectoryProjects = 'C:\Support\GitHub' 9 | #DirectoryModules = "C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules" 10 | DirectoryModules = "$Env:USERPROFILE\Documents\WindowsPowerShell\Modules" 11 | 12 | FunctionsToExport = 'Public' 13 | AliasesToExport = 'Public' 14 | 15 | Manifest = @{ 16 | # Script module or binary module file associated with this manifest. 17 | RootModule = 'PSDiscord.psm1' 18 | # Version number of this module. 19 | ModuleVersion = '0.2.X' 20 | # Minimum version of the Windows PowerShell engine required by this module 21 | PowerShellVersion = '5.1' 22 | # Supported PSEditions 23 | CompatiblePSEditions = @('Desktop', 'Core') 24 | # ID used to uniquely identify this module 25 | GUID = 'd5ae39b1-56a4-4f43-b251-e402b0c3c485' 26 | # Author of this module 27 | Author = 'Przemyslaw Klys' 28 | # Company or vendor of this module 29 | CompanyName = 'Evotec' 30 | # Copyright statement for this module 31 | Copyright = "(c) 2011 - $((Get-Date).Year) Przemyslaw Klys @ Evotec. All rights reserved." 32 | # Description of the functionality provided by this module 33 | Description = 'Simple module to send messages to Discord' 34 | # Tags applied to this module. These help with module discovery in online galleries. 35 | Tags = @('Discord', 'Messaging', 'Communication', 'Social') 36 | IconUri = 'https://evotec.xyz/wp-content/uploads/2018/12/Discord-Logo-Color.png' 37 | ProjectUri = 'https://github.com/EvotecIT/PSDiscord' 38 | #ReleaseNotes = '' 39 | RequiredModules = @( 40 | @{ ModuleName = 'PSSharedGoods'; ModuleVersion = "Latest"; Guid = 'ee272aa8-baaa-4edf-9f45-b6d6f7d844fe' } 41 | ) 42 | } 43 | } 44 | Options = @{ 45 | Merge = @{ 46 | Sort = 'None' 47 | FormatCodePSM1 = @{ 48 | Enabled = $true 49 | RemoveComments = $false 50 | FormatterSettings = @{ 51 | IncludeRules = @( 52 | 'PSPlaceOpenBrace', 53 | 'PSPlaceCloseBrace', 54 | 'PSUseConsistentWhitespace', 55 | 'PSUseConsistentIndentation', 56 | 'PSAlignAssignmentStatement', 57 | 'PSUseCorrectCasing' 58 | ) 59 | 60 | Rules = @{ 61 | PSPlaceOpenBrace = @{ 62 | Enable = $true 63 | OnSameLine = $true 64 | NewLineAfter = $true 65 | IgnoreOneLineBlock = $true 66 | } 67 | 68 | PSPlaceCloseBrace = @{ 69 | Enable = $true 70 | NewLineAfter = $false 71 | IgnoreOneLineBlock = $true 72 | NoEmptyLineBefore = $false 73 | } 74 | 75 | PSUseConsistentIndentation = @{ 76 | Enable = $true 77 | Kind = 'space' 78 | PipelineIndentation = 'IncreaseIndentationAfterEveryPipeline' 79 | IndentationSize = 4 80 | } 81 | 82 | PSUseConsistentWhitespace = @{ 83 | Enable = $true 84 | CheckInnerBrace = $true 85 | CheckOpenBrace = $true 86 | CheckOpenParen = $true 87 | CheckOperator = $true 88 | CheckPipe = $true 89 | CheckSeparator = $true 90 | } 91 | 92 | PSAlignAssignmentStatement = @{ 93 | Enable = $true 94 | CheckHashtable = $true 95 | } 96 | 97 | PSUseCorrectCasing = @{ 98 | Enable = $true 99 | } 100 | } 101 | } 102 | } 103 | FormatCodePSD1 = @{ 104 | Enabled = $true 105 | RemoveComments = $false 106 | } 107 | Integrate = @{ 108 | ApprovedModules = @('PSSharedGoods', 'PSWriteColor', 'Connectimo', 'PSUnifi', 'PSWebToolbox', 'PSMyPassword') 109 | } 110 | } 111 | Standard = @{ 112 | FormatCodePSM1 = @{ 113 | 114 | } 115 | FormatCodePSD1 = @{ 116 | Enabled = $true 117 | #RemoveComments = $true 118 | } 119 | } 120 | ImportModules = @{ 121 | Self = $true 122 | RequiredModules = $false 123 | Verbose = $false 124 | } 125 | PowerShellGallery = @{ 126 | ApiKey = 'C:\Support\Important\PowerShellGalleryAPI.txt' 127 | FromFile = $true 128 | } 129 | GitHub = @{ 130 | ApiKey = 'C:\Support\Important\GithubAPI.txt' 131 | FromFile = $true 132 | UserName = 'EvotecIT' 133 | #RepositoryName = 'PSWriteHTML' 134 | } 135 | Documentation = @{ 136 | Path = 'Docs' 137 | PathReadme = 'Docs\Readme.md' 138 | } 139 | } 140 | Steps = @{ 141 | BuildModule = @{ # requires Enable to be on to process all of that 142 | Enable = $true 143 | DeleteBefore = $false 144 | Merge = $true 145 | MergeMissing = $true 146 | SignMerged = $true 147 | Releases = $true 148 | ReleasesUnpacked = $false 149 | RefreshPSD1Only = $false 150 | } 151 | BuildDocumentation = $false 152 | ImportModules = @{ 153 | Self = $true 154 | RequiredModules = $false 155 | Verbose = $false 156 | } 157 | PublishModule = @{ # requires Enable to be on to process all of that 158 | Enabled = $true 159 | Prerelease = '' 160 | RequireForce = $false 161 | GitHub = $true 162 | } 163 | } 164 | } 165 | 166 | New-PrepareModule -Configuration $Configuration -------------------------------------------------------------------------------- /Private/Script.RGBColors.ps1: -------------------------------------------------------------------------------- 1 | $Script:RGBColors = [ordered] @{ 2 | None = $null 3 | AirForceBlue = 93, 138, 168 4 | Akaroa = 195, 176, 145 5 | AlbescentWhite = 227, 218, 201 6 | AliceBlue = 240, 248, 255 7 | Alizarin = 227, 38, 54 8 | Allports = 18, 97, 128 9 | Almond = 239, 222, 205 10 | AlmondFrost = 159, 129, 112 11 | Amaranth = 229, 43, 80 12 | Amazon = 59, 122, 87 13 | Amber = 255, 191, 0 14 | Amethyst = 153, 102, 204 15 | AmethystSmoke = 156, 138, 164 16 | AntiqueWhite = 250, 235, 215 17 | Apple = 102, 180, 71 18 | AppleBlossom = 176, 92, 82 19 | Apricot = 251, 206, 177 20 | Aqua = 0, 255, 255 21 | Aquamarine = 127, 255, 212 22 | Armygreen = 75, 83, 32 23 | Arsenic = 59, 68, 75 24 | Astral = 54, 117, 136 25 | Atlantis = 164, 198, 57 26 | Atomic = 65, 74, 76 27 | AtomicTangerine = 255, 153, 102 28 | Axolotl = 99, 119, 91 29 | Azure = 240, 255, 255 30 | Bahia = 176, 191, 26 31 | BakersChocolate = 93, 58, 26 32 | BaliHai = 124, 152, 171 33 | BananaMania = 250, 231, 181 34 | BattleshipGrey = 85, 93, 80 35 | BayOfMany = 35, 48, 103 36 | Beige = 245, 245, 220 37 | Bermuda = 136, 216, 192 38 | Bilbao = 42, 128, 0 39 | BilobaFlower = 181, 126, 220 40 | Bismark = 83, 104, 114 41 | Bisque = 255, 228, 196 42 | Bistre = 61, 43, 31 43 | Bittersweet = 254, 111, 94 44 | Black = 0, 0, 0 45 | BlackPearl = 31, 38, 42 46 | BlackRose = 85, 31, 47 47 | BlackRussian = 23, 24, 43 48 | BlanchedAlmond = 255, 235, 205 49 | BlizzardBlue = 172, 229, 238 50 | Blue = 0, 0, 255 51 | BlueDiamond = 77, 26, 127 52 | BlueMarguerite = 115, 102, 189 53 | BlueSmoke = 115, 130, 118 54 | BlueViolet = 138, 43, 226 55 | Blush = 169, 92, 104 56 | BokaraGrey = 22, 17, 13 57 | Bole = 121, 68, 59 58 | BondiBlue = 0, 147, 175 59 | Bordeaux = 88, 17, 26 60 | Bossanova = 86, 60, 92 61 | Boulder = 114, 116, 114 62 | Bouquet = 183, 132, 167 63 | Bourbon = 170, 108, 57 64 | Brass = 181, 166, 66 65 | BrickRed = 199, 44, 72 66 | BrightGreen = 102, 255, 0 67 | BrightRed = 146, 43, 62 68 | BrightTurquoise = 8, 232, 222 69 | BrilliantRose = 243, 100, 162 70 | BrinkPink = 250, 110, 121 71 | BritishRacingGreen = 0, 66, 37 72 | Bronze = 205, 127, 50 73 | Brown = 165, 42, 42 74 | BrownPod = 57, 24, 2 75 | BuddhaGold = 202, 169, 6 76 | Buff = 240, 220, 130 77 | Burgundy = 128, 0, 32 78 | BurlyWood = 222, 184, 135 79 | BurntOrange = 255, 117, 56 80 | BurntSienna = 233, 116, 81 81 | BurntUmber = 138, 51, 36 82 | ButteredRum = 156, 124, 56 83 | CadetBlue = 95, 158, 160 84 | California = 224, 141, 60 85 | CamouflageGreen = 120, 134, 107 86 | Canary = 255, 255, 153 87 | CanCan = 217, 134, 149 88 | CannonPink = 145, 78, 117 89 | CaputMortuum = 89, 39, 32 90 | Caramel = 255, 213, 154 91 | Cararra = 237, 230, 214 92 | Cardinal = 179, 33, 52 93 | CardinGreen = 18, 53, 36 94 | CareysPink = 217, 152, 160 95 | CaribbeanGreen = 0, 222, 164 96 | Carmine = 175, 0, 42 97 | CarnationPink = 255, 166, 201 98 | CarrotOrange = 242, 142, 28 99 | Cascade = 141, 163, 153 100 | CatskillWhite = 226, 229, 222 101 | Cedar = 67, 48, 46 102 | Celadon = 172, 225, 175 103 | Celeste = 207, 207, 196 104 | Cello = 55, 79, 107 105 | Cement = 138, 121, 93 106 | Cerise = 222, 49, 99 107 | Cerulean = 0, 123, 167 108 | CeruleanBlue = 42, 82, 190 109 | Chantilly = 239, 187, 204 110 | Chardonnay = 255, 200, 124 111 | Charlotte = 167, 216, 222 112 | Charm = 208, 116, 139 113 | Chartreuse = 127, 255, 0 114 | ChartreuseYellow = 223, 255, 0 115 | ChelseaCucumber = 135, 169, 107 116 | Cherub = 246, 214, 222 117 | Chestnut = 185, 78, 72 118 | ChileanFire = 226, 88, 34 119 | Chinook = 150, 200, 162 120 | Chocolate = 210, 105, 30 121 | Christi = 125, 183, 0 122 | Christine = 181, 101, 30 123 | Cinnabar = 235, 76, 66 124 | Citron = 159, 169, 31 125 | Citrus = 141, 182, 0 126 | Claret = 95, 25, 51 127 | ClassicRose = 251, 204, 231 128 | ClayCreek = 145, 129, 81 129 | Clinker = 75, 54, 33 130 | Clover = 74, 93, 35 131 | Cobalt = 0, 71, 171 132 | CocoaBrown = 44, 22, 8 133 | Cola = 60, 48, 36 134 | ColumbiaBlue = 166, 231, 255 135 | CongoBrown = 103, 76, 71 136 | Conifer = 178, 236, 93 137 | Copper = 218, 138, 103 138 | CopperRose = 153, 102, 102 139 | Coral = 255, 127, 80 140 | CoralRed = 255, 64, 64 141 | CoralTree = 173, 111, 105 142 | Coriander = 188, 184, 138 143 | Corn = 251, 236, 93 144 | CornField = 250, 240, 190 145 | Cornflower = 147, 204, 234 146 | CornflowerBlue = 100, 149, 237 147 | Cornsilk = 255, 248, 220 148 | Cosmic = 132, 63, 91 149 | Cosmos = 255, 204, 203 150 | CostaDelSol = 102, 93, 30 151 | CottonCandy = 255, 188, 217 152 | Crail = 164, 90, 82 153 | Cranberry = 205, 96, 126 154 | Cream = 255, 255, 204 155 | CreamCan = 242, 198, 73 156 | Crimson = 220, 20, 60 157 | Crusta = 232, 142, 90 158 | Cumulus = 255, 255, 191 159 | Cupid = 246, 173, 198 160 | CuriousBlue = 40, 135, 200 161 | Cyan = 0, 255, 255 162 | Cyprus = 6, 78, 64 163 | DaisyBush = 85, 53, 146 164 | Dandelion = 250, 218, 94 165 | Danube = 96, 130, 182 166 | DarkBlue = 0, 0, 139 167 | DarkBrown = 101, 67, 33 168 | DarkCerulean = 8, 69, 126 169 | DarkChestnut = 152, 105, 96 170 | DarkCoral = 201, 90, 73 171 | DarkCyan = 0, 139, 139 172 | DarkGoldenrod = 184, 134, 11 173 | DarkGray = 169, 169, 169 174 | DarkGreen = 0, 100, 0 175 | DarkGreenCopper = 73, 121, 107 176 | DarkGrey = 169, 169, 169 177 | DarkKhaki = 189, 183, 107 178 | DarkMagenta = 139, 0, 139 179 | DarkOliveGreen = 85, 107, 47 180 | DarkOrange = 255, 140, 0 181 | DarkOrchid = 153, 50, 204 182 | DarkPastelGreen = 3, 192, 60 183 | DarkPink = 222, 93, 131 184 | DarkPurple = 150, 61, 127 185 | DarkRed = 139, 0, 0 186 | DarkSalmon = 233, 150, 122 187 | DarkSeaGreen = 143, 188, 143 188 | DarkSlateBlue = 72, 61, 139 189 | DarkSlateGray = 47, 79, 79 190 | DarkSlateGrey = 47, 79, 79 191 | DarkSpringGreen = 23, 114, 69 192 | DarkTangerine = 255, 170, 29 193 | DarkTurquoise = 0, 206, 209 194 | DarkViolet = 148, 0, 211 195 | DarkWood = 130, 102, 68 196 | DeepBlush = 245, 105, 145 197 | DeepCerise = 224, 33, 138 198 | DeepKoamaru = 51, 51, 102 199 | DeepLilac = 153, 85, 187 200 | DeepMagenta = 204, 0, 204 201 | DeepPink = 255, 20, 147 202 | DeepSea = 14, 124, 97 203 | DeepSkyBlue = 0, 191, 255 204 | DeepTeal = 24, 69, 59 205 | Denim = 36, 107, 206 206 | DesertSand = 237, 201, 175 207 | DimGray = 105, 105, 105 208 | DimGrey = 105, 105, 105 209 | DodgerBlue = 30, 144, 255 210 | Dolly = 242, 242, 122 211 | Downy = 95, 201, 191 212 | DutchWhite = 239, 223, 187 213 | EastBay = 76, 81, 109 214 | EastSide = 178, 132, 190 215 | EchoBlue = 169, 178, 195 216 | Ecru = 194, 178, 128 217 | Eggplant = 162, 0, 109 218 | EgyptianBlue = 16, 52, 166 219 | ElectricBlue = 125, 249, 255 220 | ElectricIndigo = 111, 0, 255 221 | ElectricLime = 208, 255, 20 222 | ElectricPurple = 191, 0, 255 223 | Elm = 47, 132, 124 224 | Emerald = 80, 200, 120 225 | Eminence = 108, 48, 130 226 | Endeavour = 46, 88, 148 227 | EnergyYellow = 245, 224, 80 228 | Espresso = 74, 44, 42 229 | Eucalyptus = 26, 162, 96 230 | Falcon = 126, 94, 96 231 | Fallow = 204, 153, 102 232 | FaluRed = 128, 24, 24 233 | Feldgrau = 77, 93, 83 234 | Feldspar = 205, 149, 117 235 | Fern = 113, 188, 120 236 | FernGreen = 79, 121, 66 237 | Festival = 236, 213, 64 238 | Finn = 97, 64, 81 239 | FireBrick = 178, 34, 34 240 | FireBush = 222, 143, 78 241 | FireEngineRed = 211, 33, 45 242 | Flamingo = 233, 92, 75 243 | Flax = 238, 220, 130 244 | FloralWhite = 255, 250, 240 245 | ForestGreen = 34, 139, 34 246 | Frangipani = 250, 214, 165 247 | FreeSpeechAquamarine = 0, 168, 119 248 | FreeSpeechRed = 204, 0, 0 249 | FrenchLilac = 230, 168, 215 250 | FrenchRose = 232, 83, 149 251 | FriarGrey = 135, 134, 129 252 | Froly = 228, 113, 122 253 | Fuchsia = 255, 0, 255 254 | FuchsiaPink = 255, 119, 255 255 | Gainsboro = 220, 220, 220 256 | Gallery = 219, 215, 210 257 | Galliano = 204, 160, 29 258 | Gamboge = 204, 153, 0 259 | Ghost = 196, 195, 208 260 | GhostWhite = 248, 248, 255 261 | Gin = 216, 228, 188 262 | GinFizz = 247, 231, 206 263 | Givry = 230, 208, 171 264 | Glacier = 115, 169, 194 265 | Gold = 255, 215, 0 266 | GoldDrop = 213, 108, 43 267 | GoldenBrown = 150, 113, 23 268 | GoldenFizz = 240, 225, 48 269 | GoldenGlow = 248, 222, 126 270 | GoldenPoppy = 252, 194, 0 271 | Goldenrod = 218, 165, 32 272 | GoldenSand = 233, 214, 107 273 | GoldenYellow = 253, 238, 0 274 | GoldTips = 225, 189, 39 275 | GordonsGreen = 37, 53, 41 276 | Gorse = 255, 225, 53 277 | Gossamer = 49, 145, 119 278 | GrannySmithApple = 168, 228, 160 279 | Gray = 128, 128, 128 280 | GrayAsparagus = 70, 89, 69 281 | Green = 0, 128, 0 282 | GreenLeaf = 76, 114, 29 283 | GreenVogue = 38, 67, 72 284 | GreenYellow = 173, 255, 47 285 | Grey = 128, 128, 128 286 | GreyAsparagus = 70, 89, 69 287 | GuardsmanRed = 157, 41, 51 288 | GumLeaf = 178, 190, 181 289 | Gunmetal = 42, 52, 57 290 | Hacienda = 155, 135, 12 291 | HalfAndHalf = 232, 228, 201 292 | HalfBaked = 95, 138, 139 293 | HalfColonialWhite = 246, 234, 190 294 | HalfPearlLusta = 240, 234, 214 295 | HanPurple = 63, 0, 255 296 | Harlequin = 74, 255, 0 297 | HarleyDavidsonOrange = 194, 59, 34 298 | Heather = 174, 198, 207 299 | Heliotrope = 223, 115, 255 300 | Hemp = 161, 122, 116 301 | Highball = 134, 126, 54 302 | HippiePink = 171, 75, 82 303 | Hoki = 110, 127, 128 304 | HollywoodCerise = 244, 0, 161 305 | Honeydew = 240, 255, 240 306 | Hopbush = 207, 113, 175 307 | HorsesNeck = 108, 84, 30 308 | HotPink = 255, 105, 180 309 | HummingBird = 201, 255, 229 310 | HunterGreen = 53, 94, 59 311 | Illusion = 244, 152, 173 312 | InchWorm = 202, 224, 13 313 | IndianRed = 205, 92, 92 314 | Indigo = 75, 0, 130 315 | InternationalKleinBlue = 0, 24, 168 316 | InternationalOrange = 255, 79, 0 317 | IrisBlue = 28, 169, 201 318 | IrishCoffee = 102, 66, 40 319 | IronsideGrey = 113, 112, 110 320 | IslamicGreen = 0, 144, 0 321 | Ivory = 255, 255, 240 322 | Jacarta = 61, 50, 93 323 | JackoBean = 65, 54, 40 324 | JacksonsPurple = 46, 45, 136 325 | Jade = 0, 171, 102 326 | JapaneseLaurel = 47, 117, 50 327 | Jazz = 93, 43, 44 328 | JazzberryJam = 165, 11, 94 329 | JellyBean = 68, 121, 142 330 | JetStream = 187, 208, 201 331 | Jewel = 0, 107, 60 332 | Jon = 79, 58, 60 333 | JordyBlue = 124, 185, 232 334 | Jumbo = 132, 132, 130 335 | JungleGreen = 41, 171, 135 336 | KaitokeGreen = 30, 77, 43 337 | Karry = 255, 221, 202 338 | KellyGreen = 70, 203, 24 339 | Keppel = 93, 164, 147 340 | Khaki = 240, 230, 140 341 | Killarney = 77, 140, 87 342 | KingfisherDaisy = 85, 27, 140 343 | Kobi = 230, 143, 172 344 | LaPalma = 60, 141, 13 345 | LaserLemon = 252, 247, 94 346 | Laurel = 103, 146, 103 347 | Lavender = 230, 230, 250 348 | LavenderBlue = 204, 204, 255 349 | LavenderBlush = 255, 240, 245 350 | LavenderPink = 251, 174, 210 351 | LavenderRose = 251, 160, 227 352 | LawnGreen = 124, 252, 0 353 | LemonChiffon = 255, 250, 205 354 | LightBlue = 173, 216, 230 355 | LightCoral = 240, 128, 128 356 | LightCyan = 224, 255, 255 357 | LightGoldenrodYellow = 250, 250, 210 358 | LightGray = 211, 211, 211 359 | LightGreen = 144, 238, 144 360 | LightGrey = 211, 211, 211 361 | LightPink = 255, 182, 193 362 | LightSalmon = 255, 160, 122 363 | LightSeaGreen = 32, 178, 170 364 | LightSkyBlue = 135, 206, 250 365 | LightSlateGray = 119, 136, 153 366 | LightSlateGrey = 119, 136, 153 367 | LightSteelBlue = 176, 196, 222 368 | LightYellow = 255, 255, 224 369 | Lilac = 204, 153, 204 370 | Lime = 0, 255, 0 371 | LimeGreen = 50, 205, 50 372 | Limerick = 139, 190, 27 373 | Linen = 250, 240, 230 374 | Lipstick = 159, 43, 104 375 | Liver = 83, 75, 79 376 | Lochinvar = 86, 136, 125 377 | Lochmara = 38, 97, 156 378 | Lola = 179, 158, 181 379 | LondonHue = 170, 152, 169 380 | Lotus = 124, 72, 72 381 | LuckyPoint = 29, 41, 81 382 | MacaroniAndCheese = 255, 189, 136 383 | Madang = 193, 249, 162 384 | Madras = 81, 65, 0 385 | Magenta = 255, 0, 255 386 | MagicMint = 170, 240, 209 387 | Magnolia = 248, 244, 255 388 | Mahogany = 215, 59, 62 389 | Maire = 27, 24, 17 390 | Maize = 230, 190, 138 391 | Malachite = 11, 218, 81 392 | Malibu = 93, 173, 236 393 | Malta = 169, 154, 134 394 | Manatee = 140, 146, 172 395 | Mandalay = 176, 121, 57 396 | MandarianOrange = 146, 39, 36 397 | Mandy = 191, 79, 81 398 | Manhattan = 229, 170, 112 399 | Mantis = 125, 194, 66 400 | Manz = 217, 230, 80 401 | MardiGras = 48, 25, 52 402 | Mariner = 57, 86, 156 403 | Maroon = 128, 0, 0 404 | Matterhorn = 85, 85, 85 405 | Mauve = 244, 187, 255 406 | Mauvelous = 255, 145, 175 407 | MauveTaupe = 143, 89, 115 408 | MayaBlue = 119, 181, 254 409 | McKenzie = 129, 97, 60 410 | MediumAquamarine = 102, 205, 170 411 | MediumBlue = 0, 0, 205 412 | MediumCarmine = 175, 64, 53 413 | MediumOrchid = 186, 85, 211 414 | MediumPurple = 147, 112, 219 415 | MediumRedViolet = 189, 51, 164 416 | MediumSeaGreen = 60, 179, 113 417 | MediumSlateBlue = 123, 104, 238 418 | MediumSpringGreen = 0, 250, 154 419 | MediumTurquoise = 72, 209, 204 420 | MediumVioletRed = 199, 21, 133 421 | MediumWood = 166, 123, 91 422 | Melon = 253, 188, 180 423 | Merlot = 112, 54, 66 424 | MetallicGold = 211, 175, 55 425 | Meteor = 184, 115, 51 426 | MidnightBlue = 25, 25, 112 427 | MidnightExpress = 0, 20, 64 428 | Mikado = 60, 52, 31 429 | MilanoRed = 168, 55, 49 430 | Ming = 54, 116, 125 431 | MintCream = 245, 255, 250 432 | MintGreen = 152, 255, 152 433 | Mischka = 168, 169, 173 434 | MistyRose = 255, 228, 225 435 | Moccasin = 255, 228, 181 436 | Mojo = 149, 69, 53 437 | MonaLisa = 255, 153, 153 438 | Mongoose = 179, 139, 109 439 | Montana = 53, 56, 57 440 | MoodyBlue = 116, 108, 192 441 | MoonYellow = 245, 199, 26 442 | MossGreen = 173, 223, 173 443 | MountainMeadow = 28, 172, 120 444 | MountainMist = 161, 157, 148 445 | MountbattenPink = 153, 122, 141 446 | Mulberry = 211, 65, 157 447 | Mustard = 255, 219, 88 448 | Myrtle = 25, 89, 5 449 | MySin = 255, 179, 71 450 | NavajoWhite = 255, 222, 173 451 | Navy = 0, 0, 128 452 | NavyBlue = 2, 71, 254 453 | NeonCarrot = 255, 153, 51 454 | NeonPink = 255, 92, 205 455 | Nepal = 145, 163, 176 456 | Nero = 20, 20, 20 457 | NewMidnightBlue = 0, 0, 156 458 | Niagara = 58, 176, 158 459 | NightRider = 59, 47, 47 460 | Nobel = 152, 152, 152 461 | Norway = 169, 186, 157 462 | Nugget = 183, 135, 39 463 | OceanGreen = 95, 167, 120 464 | Ochre = 202, 115, 9 465 | OldCopper = 111, 78, 55 466 | OldGold = 207, 181, 59 467 | OldLace = 253, 245, 230 468 | OldLavender = 121, 104, 120 469 | OldRose = 195, 33, 72 470 | Olive = 128, 128, 0 471 | OliveDrab = 107, 142, 35 472 | OliveGreen = 181, 179, 92 473 | Olivetone = 110, 110, 48 474 | Olivine = 154, 185, 115 475 | Onahau = 196, 216, 226 476 | Opal = 168, 195, 188 477 | Orange = 255, 165, 0 478 | OrangePeel = 251, 153, 2 479 | OrangeRed = 255, 69, 0 480 | Orchid = 218, 112, 214 481 | OuterSpace = 45, 56, 58 482 | OutrageousOrange = 254, 90, 29 483 | Oxley = 95, 167, 119 484 | PacificBlue = 0, 136, 220 485 | Padua = 128, 193, 151 486 | PalatinatePurple = 112, 41, 99 487 | PaleBrown = 160, 120, 90 488 | PaleChestnut = 221, 173, 175 489 | PaleCornflowerBlue = 188, 212, 230 490 | PaleGoldenrod = 238, 232, 170 491 | PaleGreen = 152, 251, 152 492 | PaleMagenta = 249, 132, 239 493 | PalePink = 250, 218, 221 494 | PaleSlate = 201, 192, 187 495 | PaleTaupe = 188, 152, 126 496 | PaleTurquoise = 175, 238, 238 497 | PaleVioletRed = 219, 112, 147 498 | PalmLeaf = 53, 66, 48 499 | Panache = 233, 255, 219 500 | PapayaWhip = 255, 239, 213 501 | ParisDaisy = 255, 244, 79 502 | Parsley = 48, 96, 48 503 | PastelGreen = 119, 221, 119 504 | PattensBlue = 219, 233, 244 505 | Peach = 255, 203, 164 506 | PeachOrange = 255, 204, 153 507 | PeachPuff = 255, 218, 185 508 | PeachYellow = 250, 223, 173 509 | Pear = 209, 226, 49 510 | PearlLusta = 234, 224, 200 511 | Pelorous = 42, 143, 189 512 | Perano = 172, 172, 230 513 | Periwinkle = 197, 203, 225 514 | PersianBlue = 34, 67, 182 515 | PersianGreen = 0, 166, 147 516 | PersianIndigo = 51, 0, 102 517 | PersianPink = 247, 127, 190 518 | PersianRed = 192, 54, 44 519 | PersianRose = 233, 54, 167 520 | Persimmon = 236, 88, 0 521 | Peru = 205, 133, 63 522 | Pesto = 128, 117, 50 523 | PictonBlue = 102, 153, 204 524 | PigmentGreen = 0, 173, 67 525 | PigPink = 255, 218, 233 526 | PineGreen = 1, 121, 111 527 | PineTree = 42, 47, 35 528 | Pink = 255, 192, 203 529 | PinkFlare = 191, 175, 178 530 | PinkLace = 240, 211, 220 531 | PinkSwan = 179, 179, 179 532 | Plum = 221, 160, 221 533 | Pohutukawa = 102, 12, 33 534 | PoloBlue = 119, 158, 203 535 | Pompadour = 129, 20, 83 536 | Portage = 146, 161, 207 537 | PotPourri = 241, 221, 207 538 | PottersClay = 132, 86, 60 539 | PowderBlue = 176, 224, 230 540 | Prim = 228, 196, 207 541 | PrussianBlue = 0, 58, 108 542 | PsychedelicPurple = 223, 0, 255 543 | Puce = 204, 136, 153 544 | Pueblo = 108, 46, 31 545 | PuertoRico = 67, 179, 174 546 | Pumpkin = 255, 99, 28 547 | Purple = 128, 0, 128 548 | PurpleMountainsMajesty = 150, 123, 182 549 | PurpleTaupe = 93, 57, 84 550 | QuarterSpanishWhite = 230, 224, 212 551 | Quartz = 220, 208, 255 552 | Quincy = 106, 84, 69 553 | RacingGreen = 26, 36, 33 554 | RadicalRed = 255, 32, 82 555 | Rajah = 251, 171, 96 556 | RawUmber = 123, 63, 0 557 | RazzleDazzleRose = 254, 78, 218 558 | Razzmatazz = 215, 10, 83 559 | Red = 255, 0, 0 560 | RedBerry = 132, 22, 23 561 | RedDamask = 203, 109, 81 562 | RedOxide = 99, 15, 15 563 | RedRobin = 128, 64, 64 564 | RichBlue = 84, 90, 167 565 | Riptide = 141, 217, 204 566 | RobinsEggBlue = 0, 204, 204 567 | RobRoy = 225, 169, 95 568 | RockSpray = 171, 56, 31 569 | RomanCoffee = 131, 105, 83 570 | RoseBud = 246, 164, 148 571 | RoseBudCherry = 135, 50, 96 572 | RoseTaupe = 144, 93, 93 573 | RosyBrown = 188, 143, 143 574 | Rouge = 176, 48, 96 575 | RoyalBlue = 65, 105, 225 576 | RoyalHeath = 168, 81, 110 577 | RoyalPurple = 102, 51, 152 578 | Ruby = 215, 24, 104 579 | Russet = 128, 70, 27 580 | Rust = 192, 64, 0 581 | RusticRed = 72, 6, 7 582 | Saddle = 99, 81, 71 583 | SaddleBrown = 139, 69, 19 584 | SafetyOrange = 255, 102, 0 585 | Saffron = 244, 196, 48 586 | Sage = 143, 151, 121 587 | Sail = 161, 202, 241 588 | Salem = 0, 133, 67 589 | Salmon = 250, 128, 114 590 | SandyBeach = 253, 213, 177 591 | SandyBrown = 244, 164, 96 592 | Sangria = 134, 1, 17 593 | SanguineBrown = 115, 54, 53 594 | SanMarino = 80, 114, 167 595 | SanteFe = 175, 110, 77 596 | Sapphire = 6, 42, 120 597 | Saratoga = 84, 90, 44 598 | Scampi = 102, 102, 153 599 | Scarlet = 255, 36, 0 600 | ScarletGum = 67, 28, 83 601 | SchoolBusYellow = 255, 216, 0 602 | Schooner = 139, 134, 128 603 | ScreaminGreen = 102, 255, 102 604 | Scrub = 59, 60, 54 605 | SeaBuckthorn = 249, 146, 69 606 | SeaGreen = 46, 139, 87 607 | Seagull = 140, 190, 214 608 | SealBrown = 61, 12, 2 609 | Seance = 96, 47, 107 610 | SeaPink = 215, 131, 127 611 | SeaShell = 255, 245, 238 612 | Selago = 250, 230, 250 613 | SelectiveYellow = 242, 180, 0 614 | SemiSweetChocolate = 107, 68, 35 615 | Sepia = 150, 90, 62 616 | Serenade = 255, 233, 209 617 | Shadow = 133, 109, 77 618 | Shakespeare = 114, 160, 193 619 | Shalimar = 252, 255, 164 620 | Shamrock = 68, 215, 168 621 | ShamrockGreen = 0, 153, 102 622 | SherpaBlue = 0, 75, 73 623 | SherwoodGreen = 27, 77, 62 624 | Shilo = 222, 165, 164 625 | ShipCove = 119, 139, 165 626 | Shocking = 241, 156, 187 627 | ShockingPink = 255, 29, 206 628 | ShuttleGrey = 84, 98, 111 629 | Sidecar = 238, 224, 177 630 | Sienna = 160, 82, 45 631 | Silk = 190, 164, 147 632 | Silver = 192, 192, 192 633 | SilverChalice = 175, 177, 174 634 | SilverTree = 102, 201, 146 635 | SkyBlue = 135, 206, 235 636 | SlateBlue = 106, 90, 205 637 | SlateGray = 112, 128, 144 638 | SlateGrey = 112, 128, 144 639 | Smalt = 0, 48, 143 640 | SmaltBlue = 74, 100, 108 641 | Snow = 255, 250, 250 642 | SoftAmber = 209, 190, 168 643 | Solitude = 235, 236, 240 644 | Sorbus = 233, 105, 44 645 | Spectra = 53, 101, 77 646 | SpicyMix = 136, 101, 78 647 | Spray = 126, 212, 230 648 | SpringBud = 150, 255, 0 649 | SpringGreen = 0, 255, 127 650 | SpringSun = 236, 235, 189 651 | SpunPearl = 170, 169, 173 652 | Stack = 130, 142, 132 653 | SteelBlue = 70, 130, 180 654 | Stiletto = 137, 63, 69 655 | Strikemaster = 145, 92, 131 656 | StTropaz = 50, 82, 123 657 | Studio = 115, 79, 150 658 | Sulu = 201, 220, 135 659 | SummerSky = 33, 171, 205 660 | Sun = 237, 135, 45 661 | Sundance = 197, 179, 88 662 | Sunflower = 228, 208, 10 663 | Sunglow = 255, 204, 51 664 | SunsetOrange = 253, 82, 64 665 | SurfieGreen = 0, 116, 116 666 | Sushi = 111, 153, 64 667 | SuvaGrey = 140, 140, 140 668 | Swamp = 35, 43, 43 669 | SweetCorn = 253, 219, 109 670 | SweetPink = 243, 153, 152 671 | Tacao = 236, 177, 118 672 | TahitiGold = 235, 97, 35 673 | Tan = 210, 180, 140 674 | Tangaroa = 0, 28, 61 675 | Tangerine = 228, 132, 0 676 | TangerineYellow = 253, 204, 13 677 | Tapestry = 183, 110, 121 678 | Taupe = 72, 60, 50 679 | TaupeGrey = 139, 133, 137 680 | TawnyPort = 102, 66, 77 681 | TaxBreak = 79, 102, 106 682 | TeaGreen = 208, 240, 192 683 | Teak = 176, 141, 87 684 | Teal = 0, 128, 128 685 | TeaRose = 255, 133, 207 686 | Temptress = 60, 20, 33 687 | Tenne = 200, 101, 0 688 | TerraCotta = 226, 114, 91 689 | Thistle = 216, 191, 216 690 | TickleMePink = 245, 111, 161 691 | Tidal = 232, 244, 140 692 | TitanWhite = 214, 202, 221 693 | Toast = 165, 113, 100 694 | Tomato = 255, 99, 71 695 | TorchRed = 255, 3, 62 696 | ToryBlue = 54, 81, 148 697 | Tradewind = 110, 174, 161 698 | TrendyPink = 133, 96, 136 699 | TropicalRainForest = 0, 127, 102 700 | TrueV = 139, 114, 190 701 | TulipTree = 229, 183, 59 702 | Tumbleweed = 222, 170, 136 703 | Turbo = 255, 195, 36 704 | TurkishRose = 152, 119, 123 705 | Turquoise = 64, 224, 208 706 | TurquoiseBlue = 118, 215, 234 707 | Tuscany = 175, 89, 62 708 | TwilightBlue = 253, 255, 245 709 | Twine = 186, 135, 89 710 | TyrianPurple = 102, 2, 60 711 | Ultramarine = 10, 17, 149 712 | UltraPink = 255, 111, 255 713 | Valencia = 222, 82, 70 714 | VanCleef = 84, 61, 55 715 | VanillaIce = 229, 204, 201 716 | VenetianRed = 209, 0, 28 717 | Venus = 138, 127, 128 718 | Vermilion = 251, 79, 20 719 | VeryLightGrey = 207, 207, 207 720 | VidaLoca = 94, 140, 49 721 | Viking = 71, 171, 204 722 | Viola = 180, 131, 149 723 | ViolentViolet = 50, 23, 77 724 | Violet = 238, 130, 238 725 | VioletRed = 255, 57, 136 726 | Viridian = 64, 130, 109 727 | VistaBlue = 159, 226, 191 728 | VividViolet = 127, 62, 152 729 | WaikawaGrey = 83, 104, 149 730 | Wasabi = 150, 165, 60 731 | Watercourse = 0, 106, 78 732 | Wedgewood = 67, 107, 149 733 | WellRead = 147, 61, 65 734 | Wewak = 255, 152, 153 735 | Wheat = 245, 222, 179 736 | Whiskey = 217, 154, 108 737 | WhiskeySour = 217, 144, 88 738 | White = 255, 255, 255 739 | WhiteSmoke = 245, 245, 245 740 | WildRice = 228, 217, 111 741 | WildSand = 229, 228, 226 742 | WildStrawberry = 252, 65, 154 743 | WildWatermelon = 255, 84, 112 744 | WildWillow = 172, 191, 96 745 | Windsor = 76, 40, 130 746 | Wisteria = 191, 148, 228 747 | Wistful = 162, 162, 208 748 | Yellow = 255, 255, 0 749 | YellowGreen = 154, 205, 50 750 | YellowOrange = 255, 174, 66 751 | YourPink = 244, 194, 194 752 | } --------------------------------------------------------------------------------