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 […]
Renaming sequenced files in PowerShell
I’ve been scanning pages from a paperback book (by the way, did you know that Kinko’s / Fedex stores often have a paper cutter capable of cutting the spine off a paperback book, making it very easy to scan those pages?). My new HP scanner will save files in a sequence – but each time […]
Out-String and Invoke-Expression
More PowerShell work today… I’ve been working with the output from a Ruby script that we use to access Solr indexes for customer data. As I wrote previously, I’ve been able to use the ISE to create command lines to feed job names to this Ruby script and determine whether the job in question was […]
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 […]
Building GUIs for scripts
It is a truth universally acknowledged that not everyone is comfortable working with a command line. Let’s face it, some of our coworkers will never get over their desire for a good 5-cent GUI. We’re a Ruby (and Java) shop here at work, so after I learned Ruby and started writing some serious scripts, I […]
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 […]
Browser automation using PowerShell – links
One of goals in my new approach to my job is to speed up our Quality Control (QC) processes. We use an internal website for a lot of our QC checks. This website requires manual selection of each job to be checked. It would help if we could feed a list of jobs to be […]
3 1/2 Weeks…
It’s been a long 3 1/2 weeks here. The same day that I wrote my last post (Saturday, August 13), we discovered that one of our large web data servers was missing…everything. This started a couple of weeks of time-consuming data restores. We were clocking overtime hours for the first time in months. Now that […]