Voodoo PowerShell – VisioBot3000 Lives Again!

Back in January I wrote a post about how VisioBot3000 had been broken for a while, and my attempts to debug and/or diagnose the problem. In the process of developing a minimal example that illustrated the “breakage”, I noticed that accessing certain Visio object properties caused the code to work, even if the values of …

Continue reading ‘Voodoo PowerShell – VisioBot3000 Lives Again!’ »

Translating Visio VBA to PowerShell

In working on VisioBot3000, I’ve spent a lot of time looking at VBA in Visio’s macro editor. It’s one of the easiest ways to find out how things work. I thought it would be fun to take some VBA and convert it to PowerShell to demonstrate the process. We’ll start with a basic diagram using …

Continue reading ‘Translating Visio VBA to PowerShell’ »

Introducing VisioBot3000 – Part 2 (Superman?)

In the last post I showed you how VisioBot3000 makes drawing simple Visio diagrams simpler by wrapping the Visio COM API and providing more straight-forward cmdlets do refer to stencils and masters, and to draw shapes, containers, and connectors on the page. To be honest, that’s where I was expecting to end up when I started …

Continue reading ‘Introducing VisioBot3000 – Part 2 (Superman?)’ »

PowerShell and Visio Part 6 – Containers

Ok…I think this is the last of the “how to perform primitive operations in Visio” articles that I’m going to do.  Hope you’ve been enjoying them.  If you haven’t been keeping up, you can find them all here. In this installment, I’m going to show you how to create a container in Visio.  Containers are really …

Continue reading ‘PowerShell and Visio Part 6 – Containers’ »

PowerShell Code Review Guidelines

I get asked to look at other people’s PowerShell code a lot at work, and I really enjoy it.  I also find myself looking at my “old” code from several years ago (back to 2007!) and think…there’s a lot of work to be done. To that end, I’ve compiled a list of “PowerShell code review …

Continue reading ‘PowerShell Code Review Guidelines’ »

PowerShell And Visio Part 5 – Connections (updated)

It’s been a while since the last post.  I decided that if I had to chose between writing PowerShell and writing about PowerShell, I should favor the former. In this episode, I’ll talk about how to create connections between objects in a Visio diagram.  Turns out it’s not really that hard (just like most things …

Continue reading ‘PowerShell And Visio Part 5 – Connections (updated)’ »

PowerShell and Visio – Part 4 (Interlude)

Why mess with Visio from PowerShell? I’ve got a couple of posts with some really basic code to access things in PowerShell and it occurred to me…I probably haven’t made it clear why you might want to do this (other than that you can). So, instead of moving on to connections (which will be next, …

Continue reading ‘PowerShell and Visio – Part 4 (Interlude)’ »

PowerShell and Visio Part 3 – Drawing Shapes

This is part 3…if you haven’t read part 1 or part 2 you probably want to go back and read those. Now that we’re all up to speed, I promised I’d talk about drawing shapes in Visio. We’ll start with an easy one. Drawing Circles and Rectangles Remember that you have to open Visio with …

Continue reading ‘PowerShell and Visio Part 3 – Drawing Shapes’ »

PowerShell and Visio Part 2 – First Steps

Last time I talked about Visio and PowerShell and told you (in broad strokes) what I wanted to get done.  Now we’ll actually get started! Starting Visio from PowerShell To open the Visio application from PowerShell in order to start manipulating it, you need to use the appropriate COM class.  The code looks like this: …

Continue reading ‘PowerShell and Visio Part 2 – First Steps’ »

PowerShell and Visio Part 1 – Introduction

I’ve been playing around with Visio and PowerShell for quite a while now and the experience is something of a mixed bag.  My first thought was to use PowerShell to build integration diagrams, reading server names, domains, VLANs, and datacenter locations from a database, and adding color-coded connections to show the network connection requirements (e.g. …

Continue reading ‘PowerShell and Visio Part 1 – Introduction’ »