Skip to content

Commit

Permalink
Rename Send-Termbin to Out-Termbin.
Browse files Browse the repository at this point in the history
Upon reading Microsoft's documentation, I realized that, in this
case, Out was a better verb to use than Send, as I am sending data
"out" of the environment.

Thus, I have renamed Send-Termbin to Out-Termbin.  This is not a
breaking change, as I have created an alias, Send-Termbin.
  • Loading branch information
rhymeswithmogul committed Nov 22, 2020
1 parent 6e96e3c commit b93c98d
Show file tree
Hide file tree
Showing 8 changed files with 221 additions and 202 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Version 1.1 (November 22, 2020)
- Renamed Send-Termbin to Out-Termbin.
- Defined Send-Termbin as an alias for Out-Termbin.

Version 1.0.1 (October 29, 2020)
- Added online help for the Send-Termbin cmdlet.

Expand Down
7 changes: 6 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
Termbin4PS -- history of user-visible changes. Last update: 2020-09-30

Termbin4PS version 1.1, released 2020-11-22
---------------------------------------------
I realized that Out would be a better verb than Send. Thus, I've renamed the
command to Out-Termbin. Send-Termbin is now an alias, so you do not need to
rewrite any of your own scripts.

Termbin4PS version 1.0.1, released 2020-10-29
---------------------------------------------
You can now view help online by running: Get-Help Send-Termbin -Online.
That is the only change.


Termbin4PS version 1.0, released 2020-09-30
-------------------------------------------
This is the first release, so everything is new. For more information, please
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
Native [Termbin](https://termbin.com) support for PowerShell!

## Example
To send a log file to Termbin, simply pipe the raw content to `Send-Termbin`:
To send a log file to Termbin, simply pipe the raw content to `Out-Termbin`:

```powershell
PS C:\> Get-Content -Raw 'logfile.txt' | Send-Termbin
PS C:\> Get-Content -Raw 'logfile.txt' | Out-Termbin
https://termbin.com/1a2b
```

Note that you need to use `Get-Content -Raw` so that line endings are not stripped.

## Another Example
To send a process list to Termbin, simply pipe your command through `Out-String` on its way to `Send-Termbin`:
To send a process list to Termbin, simply pipe your command through `Out-String` on its way to `Out-Termbin`:

```powershell
PS C:\> Get-Process | Out-String | Send-Termbin
PS C:\> Get-Process | Out-String | Out-Termbin
```

In most cases, you will need to pass your output through PowerShell's `Out-String` so that PowerShell will convert the native .NET objects into simple strings.
8 changes: 4 additions & 4 deletions Termbin4PS.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
RootModule = 'Termbin4PS.psm1'

# Version number of this module.
ModuleVersion = '1.0.1'
ModuleVersion = '1.1'

# Supported PSEditions
CompatiblePSEditions = @('Desktop', 'Core')
Expand Down Expand Up @@ -77,16 +77,16 @@ PowerShellVersion = '5.1'
# NestedModules = @()

# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
FunctionsToExport = @('Send-Termbin')
FunctionsToExport = @('Out-Termbin')

# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
CmdletsToExport = @()

# Variables to export from this module
VariablesToExport = '*'
VariablesToExport = ''

# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
AliasesToExport = @()
AliasesToExport = @('Send-Termbin')

# DSC resources to export from this module
# DscResourcesToExport = @()
Expand Down
5 changes: 3 additions & 2 deletions Termbin4PS.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@

#Requires -Version 5.0

# .ExternalHelp Send-Termbin.xml
Function Send-Termbin {
# .ExternalHelp Out-Termbin.xml
Function Out-Termbin {
[CmdletBinding(SupportsShouldProcess, ConfirmImpact='Low')]
[OutputType([System.Uri])]
[Alias('Send-Termbin')]
Param(
[Parameter(Position=0, ValueFromPipeline)]
[String[]] $InputObject,
Expand Down
365 changes: 183 additions & 182 deletions en-US/Termbin4PS-help.xml

Large diffs are not rendered by default.

14 changes: 10 additions & 4 deletions en-US/about_Termbin4PS.help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ EXAMPLES
be sure to specify the -Raw switch to Get-Content so that line endings are
not stripped:

PS C:> Get-Content -Raw 'logfile.txt' | Send-Termbin
PS C:> Get-Content -Raw 'logfile.txt' | Out-Termbin

Or, if you want to show someone which processes are running on your system,
you can do something like this:

PS /Users/username> Get-Process | Out-String | Send-Termbin
PS /Users/username> Get-Process | Out-String | Out-Termbin

Pipe it through Out-String so that

Expand All @@ -42,7 +42,7 @@ TROUBLESHOOTING NOTE
plain text input and output. However, PowerShell is written in .NET, and it
passes objects down the pipeline. Thus, you will usually find that you need
to send your data through the cmdlet Out-String to convert it before piping
it into Send-Termbin. If you forget to do this, chances are that you will
it into Out-Termbin. If you forget to do this, chances are that you will
end up with a Termbin page full of class names. For example:

PS C:\> Get-Process | Where {$_ -Match 'pwsh'}
Expand All @@ -61,8 +61,14 @@ TROUBLESHOOTING NOTE
sure you include its -Raw switch; otherwise, PowerShell will strip the line
endings, leaving you with a jumbled mess.

HISTORY
Before version 1.1 of this module, the only cmdlet was called Send-Termbin.
I realized that Out was a better verb than Send, for what this module does.
You can still use the alias Send-Termbin, so you do not need to change your
scripts or your workflow.

SEE ALSO
Send-Termbin
Out-Termbin
Out-String
https://termbin.com
https://github.com/solusipse/fiche
Expand Down
12 changes: 7 additions & 5 deletions man/Send-Termbin_en-US.md → man/Out-Termbin_en-US.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
---
external help file: Termbin4PS-help.xml
Module Name: Termbin4PS
online version: https://github.com/rhymeswithmogul/Termbin4PS/blob/main/man/Send-Termbin_en-US.md
online version: https://github.com/rhymeswithmogul/Termbin4PS/blob/main/man/Out-Termbin_en-US.md
schema: 2.0.0
---

# Send-Termbin
# Out-Termbin

## SYNOPSIS
Send some text to Termbin.

## SYNTAX

```
Send-Termbin [[-InputObject] <String[]>] [[-Timeout] <Int32>] [-WhatIf] [-Confirm] [<CommonParameters>]
Out-Termbin [[-InputObject] <String[]>] [[-Timeout] <Int32>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

## DESCRIPTION
Expand All @@ -25,15 +25,15 @@ When using this cmdlet, you more than likely want to pipe your input through Out

### Example 1
```powershell
PS C:\> Get-Process | Out-String | Send-Termbin
PS C:\> Get-Process | Out-String | Out-Termbin
https://termbin.com/abc123
```

This will take the output of Get-Process and upload it to Termbin. If successful, a URL will be returned.

### Example 2
```powershell
PS C:\> Get-Content -Raw 'logfile.txt' | Out-String | Send-Termbin
PS C:\> Get-Content -Raw 'logfile.txt' | Out-String | Out-Termbin
https://termbin.com/def456
```

Expand Down Expand Up @@ -114,6 +114,8 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## NOTES
In almost all cases, you will want to pipe this cmdlet's input through Out-String so that it is normalized. If this cmdlet's input does not have a .ToString() method, you may wind up with a Termbin upload full of class names, or worse.
In the past, this cmdlet was called Send-Termbin. That alias still works.
## RELATED LINKS
[about_Termbin4PS](about_Termbin4PS)
Expand Down

0 comments on commit b93c98d

Please sign in to comment.