en-US/about_Termbin4PS.help.txt

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
TOPIC
    about_termbin4ps
 
SHORT DESCRIPTION
    Termbin4PS is a module that will upload its input to Termbin.
 
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
 
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.
 
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