Skip to content

Commit

Permalink
switched to single quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
techthoughts2 committed Apr 9, 2021
1 parent a994885 commit daba290
Show file tree
Hide file tree
Showing 76 changed files with 773 additions and 747 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ Send-TelegramDice -BotToken $botToken -ChatID $chat -Emoji $emoji
#sending a telegram message from older versions of powershell
###########################################################################
#here is an example of calling PowerShell 6.1+ from PowerShell 5.1 to send a Telegram message with PoshGram
& 'C:\Program Files\PowerShell\6\pwsh.exe' -command { Import-Module PoshGram;$token = "#########:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx";$chat = "-nnnnnnnnn";Send-TelegramTextMessage -BotToken $token -ChatID $chat -Message "Test from 5.1 calling 6.1+ to send Telegram Message via PoshGram" }
& 'C:\Program Files\PowerShell\6\pwsh.exe' -command { Import-Module PoshGram;$token = '#########:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx';$chat = '-nnnnnnnnn';Send-TelegramTextMessage -BotToken $token -ChatID $chat -Message "Test from 5.1 calling 6.1+ to send Telegram Message via PoshGram" }
#--------------------------------------------------------------------------
#here is an example of calling PowerShell 6.1+ from PowerShell 5.1 to send a Telegram message with PoshGram using dynamic variables in the message
$token = “#########:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx”
Expand All @@ -166,7 +166,7 @@ $test = "I am a test"
& '.\Program Files\PowerShell\6\pwsh.exe' -command "& {Import-Module PoshGram;Send-TelegramTextMessage -BotToken $token -ChatID $chat -Message '$test';}"
#--------------------------------------------------------------------------
#here is an example of calling PowerShell 7+ from PowerShell 5.1 to send a Telegram message with PoshGram
& 'C:\Program Files\PowerShell\7-preview\pwsh.exe' -command { Import-Module PoshGram;$token = "#########:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx";$chat = "-nnnnnnnnn";Send-TelegramTextMessage -BotToken $token -ChatID $chat -Message "Test from 5.1 calling 7+ to send Telegram Message via PoshGram" }
& 'C:\Program Files\PowerShell\7-preview\pwsh.exe' -command { Import-Module PoshGram;$token = '#########:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx';$chat = '-nnnnnnnnn';Send-TelegramTextMessage -BotToken $token -ChatID $chat -Message "Test from 5.1 calling 7+ to send Telegram Message via PoshGram" }
#--------------------------------------------------------------------------
```

Expand Down
2 changes: 1 addition & 1 deletion docs/PoshGram-FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Send-TelegramTextMessage -BotToken $token -ChatID $channel -Message "This is a s

```powershell
#here is an example of calling PowerShell 6.1+ from PowerShell 5.1 to send a Telegram message with PoshGram
& 'C:\Program Files\PowerShell\6\pwsh.exe' -command { Import-Module PoshGram;$token = "#########:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx";$chat = "-nnnnnnnnn";Send-TelegramTextMessage -BotToken $token -ChatID $chat -Message "Test from 5.1 calling 6.1 to send Telegram Message via PoshGram" }
& 'C:\Program Files\PowerShell\6\pwsh.exe' -command { Import-Module PoshGram;$token = '#########:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx';$chat = '-nnnnnnnnn';Send-TelegramTextMessage -BotToken $token -ChatID $chat -Message "Test from 5.1 calling 6.1 to send Telegram Message via PoshGram" }
```

### Are there any restrictions when using PoshGram?
Expand Down
8 changes: 4 additions & 4 deletions docs/Send-TelegramContact.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ Uses Telegram Bot API to send contact information to specified Telegram chat.

### EXAMPLE 1
```
$botToken = "nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx"
$chat = "-nnnnnnnnn"
$botToken = 'nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx'
$chat = '-nnnnnnnnn'
$phone = '1-222-222-2222'
$firstName = 'Jean-Luc'
Send-TelegramContact -BotToken $botToken -ChatID $chat -PhoneNumber $phone -FirstName $firstName
Expand All @@ -35,8 +35,8 @@ Sends contact via Telegram API

### EXAMPLE 2
```
$botToken = "nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx"
$chat = "-nnnnnnnnn"
$botToken = 'nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx'
$chat = '-nnnnnnnnn'
$phone = '1-222-222-2222'
$firstName = 'Jean-Luc'
$lastName = 'Picard'
Expand Down
8 changes: 4 additions & 4 deletions docs/Send-TelegramDice.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ Uses Telegram Bot API to send animated emoji that will display a random value to

### EXAMPLE 1
```
$botToken = "nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx"
$chat = "-nnnnnnnnn"
$botToken = 'nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx'
$chat = '-nnnnnnnnn'
$emoji = 'basketball'
Send-TelegramDice -BotToken $botToken -ChatID $chat -Emoji $emoji
```
Expand All @@ -34,8 +34,8 @@ Sends animated basketball emoji that displays a random value via Telegram API

### EXAMPLE 2
```
$botToken = "nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx"
$chat = "-nnnnnnnnn"
$botToken = 'nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx'
$chat = '-nnnnnnnnn'
$emoji = 'dice'
$sendTelegramDiceSplat = @{
BotToken = $botToken
Expand Down
22 changes: 11 additions & 11 deletions docs/Send-TelegramLocalAnimation.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,24 @@ Several options can be specified to adjust message parameters.

### EXAMPLE 1
```
$botToken = "nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx"
$chat = "-nnnnnnnnn"
$animation = "C:\animation\animation.gif"
$botToken = 'nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx'
$chat = '-nnnnnnnnn'
$animation = 'C:\animation\animation.gif'
Send-TelegramLocalAnimation -BotToken $botToken -ChatID $chat -AnimationPath $animation
```

Sends AnimationPath message via Telegram API

### EXAMPLE 2
```
$botToken = "nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx"
$chat = "-nnnnnnnnn"
$animation = "C:\animation\animation.gif"
$botToken = 'nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx'
$chat = '-nnnnnnnnn'
$animation = 'C:\animation\animation.gif'
$sendTelegramLocalAnimationSplat = @{
BotToken = $botToken
ChatID = $chat
AnimationPath = $animation
Caption = "Check out this animation"
Caption = 'Check out this animation'
ParseMode = 'MarkdownV2'
DisableNotification = $true
Verbose = $true
Expand All @@ -55,14 +55,14 @@ Sends animation message via Telegram API

### EXAMPLE 3
```
$botToken = "nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx"
$chat = "-nnnnnnnnn"
$animation = "C:\animation\animation.gif"
$botToken = 'nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx'
$chat = '-nnnnnnnnn'
$animation = 'C:\animation\animation.gif'
$sendTelegramLocalAnimationSplat = @{
BotToken = $botToken
ChatID = $chat
AnimationPath = $animation
Caption = "Check out this __awesome__ animation\."
Caption = 'Check out this __awesome__ animation\.'
ParseMode = 'MarkdownV2'
}
Send-TelegramLocalAnimation @sendTelegramLocalAnimationSplat
Expand Down
49 changes: 33 additions & 16 deletions docs/Send-TelegramLocalAudio.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Sends Telegram audio message via Bot API from locally sourced file
```
Send-TelegramLocalAudio [-BotToken] <String> [-ChatID] <String> [-Audio] <String> [[-Caption] <String>]
[[-ParseMode] <String>] [[-Duration] <Int32>] [[-Performer] <String>] [[-Title] <String>]
[-DisableNotification] [<CommonParameters>]
[[-FileName] <String>] [-DisableNotification] [<CommonParameters>]
```

## DESCRIPTION
Expand All @@ -28,28 +28,29 @@ Telegram only supports mp3 audio.

### EXAMPLE 1
```
$botToken = "nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx"
$chat = "-nnnnnnnnn"
$audio = "C:\audio\halo_on_fire.mp3"
$botToken = 'nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx'
$chat = '-nnnnnnnnn'
$audio = 'C:\audio\halo_on_fire.mp3'
Send-TelegramLocalAudio -BotToken $botToken -ChatID $chat -Audio $audio
```

Sends audio message via Telegram API

### EXAMPLE 2
```
$botToken = "nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx"
$chat = "-nnnnnnnnn"
$audio = "C:\audio\halo_on_fire.mp3"
$botToken = 'nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx'
$chat = '-nnnnnnnnn'
$audio = 'C:\audio\halo_on_fire.mp3'
$sendTelegramLocalAudioSplat = @{
BotToken = $botToken
ChatID = $chat
Audio = $audio
Caption = "Check out this audio track"
Caption = 'Check out this audio track'
ParseMode = 'MarkdownV2'
Duration = 495
Performer = "Metallica"
Title = "Halo On Fire"
Performer = 'Metallica'
Title = 'Halo On Fire'
FileName = 'halo_on_fire.mp3'
DisableNotification = $true
Verbose = $true
}
Expand All @@ -60,16 +61,17 @@ Sends audio message via Telegram API

### EXAMPLE 3
```
$botToken = "nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx"
$chat = "-nnnnnnnnn"
$audio = "C:\audio\halo_on_fire.mp3"
$botToken = 'nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx'
$chat = '-nnnnnnnnn'
$audio = 'C:\audio\halo_on_fire.mp3'
$sendTelegramLocalAudioSplat = @{
BotToken = $botToken
ChatID = $chat
Audio = $audio
Title = "Halo On Fire"
Performer = "Metallica"
Caption = "Check out this __awesome__ audio track\."
Performer = 'Metallica'
Title = 'Halo On Fire'
FileName = 'halo_on_fire.mp3'
Caption = 'Check out this __awesome__ audio track\.'
ParseMode = 'MarkdownV2'
}
Send-TelegramLocalAudio @sendTelegramLocalAudioSplat
Expand Down Expand Up @@ -200,6 +202,21 @@ Accept pipeline input: False
Accept wildcard characters: False
```
### -FileName
Original File Name
```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 9
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -DisableNotification
Send the message silently.
Users will receive a notification with no sound.
Expand Down
22 changes: 11 additions & 11 deletions docs/Send-TelegramLocalDocument.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,24 @@ Several options can be specified to adjust message parameters.

### EXAMPLE 1
```
$botToken = "nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx"
$chat = "-nnnnnnnnn"
$file = "C:\Logs\Log1.txt"
$botToken = 'nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx'
$chat = '-nnnnnnnnn'
$file = 'C:\Logs\Log1.txt'
Send-TelegramLocalDocument -BotToken $botToken -ChatID $chat -File $file
```

Sends document message via Telegram API

### EXAMPLE 2
```
$botToken = "nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx"
$chat = "-nnnnnnnnn"
$file = "C:\Logs\Log1.txt"
$botToken = 'nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx'
$chat = '-nnnnnnnnn'
$file = 'C:\Logs\Log1.txt'
$sendTelegramLocalDocumentSplat = @{
BotToken = $botToken
ChatID = $chat
File = $file
Caption = "Check out this file"
Caption = 'Check out this file'
ParseMode = 'MarkdownV2'
DisableNotification = $true
Verbose = $true
Expand All @@ -55,14 +55,14 @@ Sends document message via Telegram API

### EXAMPLE 3
```
$botToken = "nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx"
$chat = "-nnnnnnnnn"
$file = "C:\Logs\Log1.txt"
$botToken = 'nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx'
$chat = '-nnnnnnnnn'
$file = 'C:\Logs\Log1.txt'
$sendTelegramLocalDocumentSplat = @{
BotToken = $botToken
ChatID = $chat
File = $file
Caption = "Check out this __important__ file\."
Caption = 'Check out this __important__ file\.'
ParseMode = 'MarkdownV2'
}
Send-TelegramLocalDocument @sendTelegramLocalDocumentSplat
Expand Down
22 changes: 11 additions & 11 deletions docs/Send-TelegramLocalPhoto.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,24 @@ Several options can be specified to adjust message parameters.

### EXAMPLE 1
```
$botToken = "nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx"
$chat = "-nnnnnnnnn"
$photo = "C:\photos\aphoto.jpg"
$botToken = 'nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx'
$chat = '-nnnnnnnnn'
$photo = 'C:\photos\aphoto.jpg'
Send-TelegramLocalPhoto -BotToken $botToken -ChatID $chat -PhotoPath $photo
```

Sends photo message via Telegram API

### EXAMPLE 2
```
$botToken = "nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx"
$chat = "-nnnnnnnnn"
$photo = "C:\photos\aphoto.jpg"
$botToken = 'nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx'
$chat = '-nnnnnnnnn'
$photo = 'C:\photos\aphoto.jpg'
$sendTelegramLocalPhotoSplat = @{
BotToken = $botToken
ChatID = $chat
PhotoPath = $photo
Caption = "Check out this photo"
Caption = 'Check out this photo'
ParseMode = 'MarkdownV2'
DisableNotification = $true
Verbose = $true
Expand All @@ -55,14 +55,14 @@ Sends photo message via Telegram API

### EXAMPLE 3
```
$botToken = "nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx"
$chat = "-nnnnnnnnn"
$photo = "C:\photos\aphoto.jpg"
$botToken = 'nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx'
$chat = '-nnnnnnnnn'
$photo = 'C:\photos\aphoto.jpg'
$sendTelegramLocalPhotoSplat = @{
BotToken = $botToken
ChatID = $chat
PhotoPath = $photo
Caption = "Check out this __awesome__ photo\."
Caption = 'Check out this __awesome__ photo\.'
ParseMode = 'MarkdownV2'
}
Send-TelegramLocalPhoto @sendTelegramLocalPhotoSplat
Expand Down
12 changes: 6 additions & 6 deletions docs/Send-TelegramLocalSticker.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ The sticker will be sourced from the local device and uploaded to telegram.

### EXAMPLE 1
```
$botToken = "nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx"
$chat = "-nnnnnnnnn"
$sticker = "C:\stickers\sticker.webp"
$botToken = 'nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx'
$chat = '-nnnnnnnnn'
$sticker = 'C:\stickers\sticker.webp'
Send-TelegramLocalSticker -BotToken $botToken -ChatID $chat -StickerPath $sticker
```

Sends sticker message via Telegram API

### EXAMPLE 2
```
$botToken = "nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx"
$chat = "-nnnnnnnnn"
$sticker = "C:\stickers\sticker.webp"
$botToken = 'nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx'
$chat = '-nnnnnnnnn'
$sticker = 'C:\stickers\sticker.webp'
$sendTelegramLocalStickerSplat = @{
BotToken = $botToken
ChatID = $chat
Expand Down
22 changes: 11 additions & 11 deletions docs/Send-TelegramLocalVideo.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,27 @@ Telegram only supports mp4 videos.

### EXAMPLE 1
```
$botToken = "nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx"
$chat = "-nnnnnnnnn"
$file = "C:\videos\video.mp4"
$botToken = 'nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx'
$chat = '-nnnnnnnnn'
$file = 'C:\videos\video.mp4'
Send-TelegramLocalVideo -BotToken $botToken -ChatID $chat -Video $video
```

Sends video message via Telegram API

### EXAMPLE 2
```
$botToken = "nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx"
$chat = "-nnnnnnnnn"
$video = "C:\videos\video.mp4"
$botToken = 'nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx'
$chat = '-nnnnnnnnn'
$video = 'C:\videos\video.mp4'
$sendTelegramLocalVideoSplat = @{
BotToken = $botToken
ChatID = $chat
Video = $video
Duration = 10
Width = 250
Height = 250
Caption = "Check out this video"
Caption = 'Check out this video'
ParseMode = 'MarkdownV2'
Streaming = $true
DisableNotification = $true
Expand All @@ -61,15 +61,15 @@ Sends video message via Telegram API

### EXAMPLE 3
```
$botToken = "nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx"
$chat = "-nnnnnnnnn"
$video = "C:\videos\video.mp4"
$botToken = 'nnnnnnnnn:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx'
$chat = '-nnnnnnnnn'
$video = 'C:\videos\video.mp4'
$sendTelegramLocalVideoSplat = @{
BotToken = $botToken
ChatID = $chat
Video = $video
Streaming = $true
Caption = "Check out this __awesome__ video\."
Caption = 'Check out this __awesome__ video\.'
ParseMode = 'MarkdownV2'
}
Send-TelegramLocalVideo @sendTelegramLocalVideoSplat
Expand Down
Loading

0 comments on commit daba290

Please sign in to comment.