en-US/about_Termbin4PS.help.txt
TOPIC
about_Termbin4PS SHORT DESCRIPTION Termbin4PS is a module that will upload its input to Termbin, or any other Termbin-compatible service. LONG DESCRIPTION Termbin is a wonderful online service (in this author's opinion) that takes whatever plain text it is given and uploads it to a web server. From there, it can be easily shared with the world. However, getting data to it relies on the third-party tool Netcat. While it is usually included with macOS and Linux, it is not a part of Windows. Termbin4PS is a PowerShell module (compatible with Core editions) that uses native .NET functionality to feed data to Termbin, eliminating the need for Netcat to be installed. Upon success, the user will be given a URL like https://termbin.com/abc123 that they can share with anyone, as if they had used Netcat. EXAMPLES For example, if you want to share the contents of a log file, do this, and be sure to specify the -Raw switch to Get-Content so that line endings are not stripped: 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 | Out-Termbin Pipe it through Out-String so that multiple objects get converted properly to strings. Finally, you can use other Termbin-compatible services by specifying that service's hostname and port: PS> echo "Hello, World!" | Out-Termbin -HostName another.termbin -Port 9999 NOTE This module is in no way related to Termbin, nor is it related to solusipse or his fiche project on GitHub. I'm just a fan of Termbin who tends to work on Windows systems, and usually needs to share something with someone. TROUBLESHOOTING NOTE Termbin works great under shells like Bash, because those tend to deal with 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 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'} NPM(K) PM(M) WS(M) CPU(s) Id SI ProcessName ------ ----- ----- ------ -- -- ----------- 0 0.00 38.98 4.39 29129 …29 pwsh 0 0.00 60.63 16.06 29144 …44 pwsh While it looks fine on the screen, that's because PowerShell quietly passed it to Out-String, that same text turned into this when it reached Termbin: System.Diagnostics.Process (pwsh)System.Diagnostics.Process (pwsh) Always pass it through Out-String! Alternatively, if using Get-Content, be 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. LEGAL DISCLAIMER By choosing to send data to Termbin, you agree implicitly to Termbin's terms of service. Should you choose to use a third-party service (with -HostName), then it is assumed that you agree to that other server's terms of service. SEE ALSO Out-Termbin Out-String https://termbin.com https://github.com/solusipse/fiche https://github.com/rhymeswithmogul/Termbin4PS/ KEYWORDS - Termbin - Termbin_for_PS - Termbin_for_PowerShell |