PowerShellで標準入力をクリップボードに送るclip.ps1
clip.ps1
ほにゃらら
へにゃらら
ふにゃらら
^Z
clip.ps1 <ファイル
コマンド | clip.ps1
$stdin=@()+$input
if($stdin.length){
$stdin=[String]::Join("`r`n",$stdin)
}else{
$stdin=[System.Console]::In.ReadToEnd()
}
[void][Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
$textbox = new-object System.Windows.Forms.TextBox
$textbox.Multiline = $true
$textbox.Text = $stdin
$textbox.SelectAll()
$textbox.Copy()
« 標準出力と標準エラーを別々にパイプに渡す。 | トップページ | PowerShell.exeで標準入力をクリップボードに送る1行バッチファイル »