Renaming Sequenced Files in PowerShell – part 2

Since last month, I’ve made a small change to the way I rename the files produced by my scanner. I wrote the following short function: function nuname ($n) { [void]($n -match “Page(\d+)_(\d+)”) return “Page” + [string]([int]$matches[1] + [int]$matches[2]) + “.png” } And now, instead of naming files “Page ###”, I simply export them from the […]

Getting back to JavaScript

I’m adding a new Category to this blog, because I’m getting serious about a new subject: JavaScript. In some ways, it’s a natural development of some work I’m doing at my job. As I wrote previously, I’ve decided to try automating our web Quality Control (QC) processes using PowerShell to drive Internet Explorer.  Of course, […]

PowerShell – Searching a big text file, the Out-GridView cmdlet

Searching a big text file in PowerShell Where I work, we use simple text files as menus for our web applications. These menus may reference hundreds of jobs per month, and span up to 84 months (7 years) in some cases. Looking up lines in these files can be very time-consuming. Since I’m writing scripts […]

Editing PowerShell scripts from the ISE command line, part 2

A couple of days ago, I talked about using the ISE command line to create script lines in the active script tab. My process was: Switch to the email program, Copy the job name or full line out of the error email, Switch back to the PowerShell ISE, and Up-Arrow to create each new line […]

Use Shift-Enter (not Enter) to continue lines in the ISE command pane

Something that’s been bugging me for a while is that I couldn’t remember how to continue lines in the ISE command pane. Of course, in a regular PowerShell window, you can just press Enter to continue entering a command on the next line: PS C:\Users\Owner> 1..10 | Where-Object{ ($_ % 2) -eq 0 } 2 […]

Editing PowerShell scripts from the ISE command line

One of the things I do at work involves creating scripts to run a Ruby script. For each line in each script I create, I have to: Go to our secondary email program Copy a job name (a word, basically) or an entire line from an error email Change to an editing program (like the […]