copycon powershell command
FYI: I didn't create this, I found it on the web (I did add the -encoding bit). But it's so damn useful I've got to post it (if you're an old dos guy used to typing copy con newfile.txt and the like)
Function CopyfromConsole {
param ($outfile = "")
# encoding is set to ascii because if we leave it at the default
# (unicode), svn treats it as a binary file, which is
# inconvienent for me personally, so old skewl ascii it is
if ($outfile -eq "")
{
# out-file will prompt user for filename if we don't specify one
[system.console]::in.readtoend() | out-file -encoding ascii
}
Else
{
[system.console]::in.readtoend() | out-file $outfile -encoding ascii
}
}
set-alias copycon CopyfromConsole
So now just type copycon NewFile.txt, and it's easy for me to create a file
update: credit where credit is do, I found the blog entry this originated from, so thanks to Thomas Lee