PowerShell: Synchronizing a Folder (and Sub-Folders) Part 5

I’ve made some more changes to the syncing script. The first was some corrections about how it deals with paths with ‘odd’ symbols in them (like “[“) and the second was to properly output objects listing all the changes its made (for logging or further processing).

Update : I’ve revisited this script a few times with new additions and modifications.The latest full version of the script is here.  That post also includes links covering the other revisions to the script.

Continue reading “PowerShell: Synchronizing a Folder (and Sub-Folders) Part 5”

PowerShell: Converting PDF Bank Statements to PDF

I wrote some very quick and dirty code to import American Express PDF statements to CSV here.  I could export the PDF to TXT and then process the text file with PowerShell.I had to revisit it the other day as I had a raft of PDF statements to convert and import into YNAB (and not just from AMEX).

Of course, all the bank and credit card vendors use a standard PDF format for statements so it was easy.

Right?

No, actually pretty much everyone just does their own thing.  And by ‘own thing’ I mean PDFs that are not even consistent within themselves.

So:  the joy of regular expressions. Continue reading “PowerShell: Converting PDF Bank Statements to PDF”

Tales From IT: Don’t Confuse Relative and Absolute Pathnames!

This incident occurred in the first place I worked and it proved to me just how much damage a little ignorance can do (unfortunately I was the source of the little ignorance in this story).

More specifically, a little ignorance, god-like permissions and a hacked-together backup system built out of scripts. Continue reading “Tales From IT: Don’t Confuse Relative and Absolute Pathnames!”

PowerShell: Copy Directory Structure and a Random Sample of Files from Each Directory

I got my wife a new digital picture frame as a present.  It looks cool but the attached storage options (USB or card) aren’t big enough to take all our digital photos.

The decision about which pictures to include relies on either organisational skills OR an artistic eye, neither of which I have.

So what about making it strictly random?  Copying the entire directory structure but only a random sample of the files in each folder?

That I CAN do 🙂 Continue reading “PowerShell: Copy Directory Structure and a Random Sample of Files from Each Directory”

Tales From IT: I Don’t Want To Win If They Don’t Lose

IT projects past a certain size get quite complex.  They have a lot of moving parts and often those parts have to be aligned correctly and at the right time to make everything work.  In turn, that means you need the various people to pull together to make sure the project as a whole delivers.  Sometimes the team doesn’t succeed but normally everyone is pulling in the same direction.  There is no “I” in team!  Etc Etc

There are exceptions.  In one place I worked the IT departments were actively trying to push each other under a bus.  Think ‘Game Of Thrones’ with RAID arrays.

Ethernet 1
Day 1 : How to Make a Garotte out of Ethernet Cable

It made delivering the project…. interesting. Continue reading “Tales From IT: I Don’t Want To Win If They Don’t Lose”

PowerShell: Fixing “Windows could not connect to the Group Policy Client service”

My wife got this error the other day on her Windows 10 machine when trying to login.  After a bit of digging, it seems it’s not unheard of but there’s no clear answer about why it happens (It’s a corrupted / missing set of registry entries.  The cause could be a bad shut-down, crash, interrupted update or pre-cursor to Martian attack.  Who knows.)

I found a good site that provides a solution. To fix the issue you need to create a registry sub-key and value (confusingly, both of the same name) and a pair of values under the sub-key you just created. That cures the problem but there’s no more information about to how to prevent it happening again.

In lieu of a proper preventative solution I wrote a script to perform the changes (with a bit of safety code too) so if it re-occurs I’m good to go.

Script and walk-through after the line. Continue reading “PowerShell: Fixing “Windows could not connect to the Group Policy Client service””

What does your computer hear when it listens without you knowing?

HALA lot of people are worried about computers listening in to what you’re doing.  Some of the people’s points are valid, while others come across as totally paranoid.  But what does your computer hear in the background?

I left my copy of VoiceAttack going after I finished playing Elite without realising it.  I didn’t have my mic on but it was live on my desk.  VoiceAttack uses the speech recognition system built into Windows and this is what my PC thought I was saying… Continue reading “What does your computer hear when it listens without you knowing?”