Tag Archives: powershell

PowerShell Log function with word wrapped output to the screen

I like to have logging in most scripts I write, and this is the current incarnation of my logging function. It logs to c:\location\of\script.ps1.log (or wherever/whatever your script is named). It uses write-host to output a word wrapped version of … Continue reading

Posted in General | Tagged | Leave a comment

Batch file bootstrap PowerShell script for easy double click running

The scenario is you have a PowerShell script that takes no paramaters and prompts the user for all the information it needs. How do you make it extra simple for people to check it out of source control and run … Continue reading

Posted in General | Tagged , | Leave a comment

[SOLVED] svn user commits _svn folder !?!?!?

Names and paths changed to protect the innocent 🙂 Here’s a quick one that wreaked a moment of havoc. A user had comitted _svn folders to the repository. The build server uses _svn instead of .svn by way of an … Continue reading

Posted in General | Tagged , | Leave a comment

Powershell: Invoke-Expression and Tee-Object

So in my previous post I wrote about how I got around a problem with some standard error from Perforce. I want to take my work around function and pipe it into Tee-object so I can simultaneously display and log … Continue reading

Posted in General | Tagged | 2 Comments

Weird Powershell Standard Error Behavior

Ok I’m baffled. I am working on the previously mentioned powershell perforce backup script. I intentionally corrupted one of my database files to make sure I’m correctly catching the error. This ran me into a brick wall with trying to … Continue reading

Posted in General | Tagged | Leave a comment

PowerShell V1 doesn’t like to exit assignment functions

I was working on a fancy backup script for Perforce written in Powershell and I’ve definitely come across a bug in PowerShell V1.  Take a look at this: function Usage() { write-host "Hey fool, you need to pass 1 paramter … Continue reading

Posted in General | Tagged | 1 Comment