Making noises

On January 11, 2007, Posted by , In Cool,PowerShell,Quiz, With 4 Comments

There are twothree ways I know of to make noises in PowerShell. 1. Simple and most boring: use the internal speaker’s beep. write-host “`a`a`a” 2. Slightly better, use the .NET console beep. This plays A above middle C for one second. [console]::beep(440,1000) Both of the above are synchronous, ie, the…

Script Updates

On January 10, 2007, Posted by , In Cool,PowerShell, With Comments Off on Script Updates

After receiving feedback from a few people (thanks!), I’ve updated two of the scripts posted here previously. Convert images to text (ASCII art) This had a problem where a division by zero error would occur if the specified image file wasn’t fully qualified. Fixed script is here: convert-image2text.ps1. Console screen…

Text and path gotchas

On January 9, 2007, Posted by , In Rant, With 1 Comment

PowerShell is now my default Windows shell, but every now and then, little things crop up that make me want to go back to CMD.exe, or better cygwin/zsh. Someone gave me an example of filtering an ASCII text file, stripping out the first 3 characters of each line. On a…

What colour is yours?

On January 8, 2007, Posted by , In Odd,PowerShell, With 3 Comments

I noticed something very odd today. My PowerShell console thinks that the default white text is actually “DarkYellow.” If I set it to “White” there is no visible difference. What colour is your default console? Update: I’ve found a use for “darkyellow” being white. When you run something like findstr…

Moving to WordPress

On January 8, 2007, Posted by , In Announce, With Comments Off on Moving to WordPress

I’ve been having problems with RapidWeaver as my blogging software, not limited to RSS links being broken, and no previous/next links for the blog, so I’ve decided to move it to WordPress. It looks like it’s all ok now, but if you see anything broken, please let me know. The…

Convert images to text (ASCII art)

On January 7, 2007, Posted by , In Cool,PowerShell,Utility, With 6 Comments

Recently, whilst messing with sprites and the Grrr framework, I got thinking about better graphics for games. As PowerShell is very slow at doing console atomic write operations, a game should really have fewer, larger sprites. I then thought about ASCII art, and wouldn’t it be great if PowerShell could…

Console screen grabs in html

On January 6, 2007, Posted by , In Cool,PowerShell,Utility, With 4 Comments

[Updated 25 Jan 2007, well rewritten 🙂 ] Something I find myself doing a lot is getting a screen shot of a PowerShell console window and posting it some place. Unfortunately, its always a bitmap, and occasionally, I want it as formatted text. Now, the console is readable via $host.ui.rawui.GetBufferContents,…

Sudoku

On January 5, 2007, Posted by , In Cool,PowerShell, With 1 Comment

Some time ago, I wrote a Sudoku solver in Java, along with an editor, interactive hint mode, puzzle generator etc, but the project never got finished because of feature creep and I generally got a bit bored of it all. This morning, I resurrected the project and implemented the solver…

Minor gripes

On January 4, 2007, Posted by , In Rant, With Comments Off on Minor gripes

A number of little things bother me about PowerShell, and I’d just like to outline them here. Adding to arrays According to get-help about_array : “You can append an element to an existing array by using the += operator. When the operator is used on the array itself, it appends…

Grrr!

On January 3, 2007, Posted by , In Cool,Grrr,PowerShell, With 1 Comment

Despite the title, this is not a rant 🙂 Grrr is a pet project of mine that came after the exploratory work with psinvaders. I was somewhat dissatisfied with myself for doing so much without seeing how else it could be done, especially with respect to drawing of images, animation,…