I can easily say that the quantity and caliber of script submissions in this year’s Scripting Games has been amazing. I congratulate all of you on your hard work and trust it will pay off. I’d say a primary goal is education. Not only will you pick up tips from the judges but also from…
Category: PowerShell ISE
Convert Aliases with the Tokenizer
Last week I posted a function you can use in the Windows PowerShell ISE to convert aliases to command definitions. My script relied on regular expressions to seek out and replace aliases. A number of people asked me why I didn’t use the PowerShell tokenizer. My answer was that because I’m not a developer and…
PowerShell ISE Alias to Command
Earlier this week I posted a function that you could incorporate into the PowerShell ISE to convert selected text to upper or lower case. I was challenged to take this a step further and come up with a way to convert aliases to commands. Which is exactly what I did.
PowerShell ISE Case Closed
When writing a PowerShell script or function, things like indentations, white space and case make a big difference in how easy it is to read and understand your code. Sometimes it can be helpful to have a word or sentence in all upper case so that it stands out. Here is a simple set of…
New Comment Help
If you follow my blog I’m sure you noticed that I post a lot of advanced functions and scripts. While I don’t expect every one to be developing advanced functions, the closer you can get the more powerful your work. With the Scripting Games approaching I thought I’d offer up a little something to help…
Friday Fun Create Numbered File
I was working on my guest commentary for the upcoming Scripting Games and started thinking I would need a line numbered version of my solution to help explain. Turns out I didn’t go down that road, but in the process I put together a little PowerShell to take a text file and create a line…
Friday Fun ConvertTo Text File
When I’m working on simple PowerShell scripts, I find myself using the PowerShell ISE. When I need to share those scripts on my blog I inevitably need to save the script as a text file so I can post it. I finally realized that instead of the few manual steps, I could automate this process.
A few ISE tweaks
If you use the PowerShell ISE as your primary script editor, you might want to tweak it a bit. The first thing you’ll need is your ISE profile script. If it doesn’t exist, you’ll need to create. PowerShell will look for file C:\Users\USERNAME\Documents\WindowsPowerShell\Microsoft.PowerShellISE_profile.ps1 (on Windows 7 anyway). Any commands you put in this file will…
PowerShell ISE Most Recent Files
The PowerShell ISE is a handy tool for editing and testing your scripts, functions and modules. If you can’t afford a good commercial editor then you should at least be using the ISE. One benefit of the ISE is that it has its own object model which means it is extensible. One thing I always…
Friday Fun – The Kitchen Sink Prompt
On my last Friday Fun post on PowerShell prompts, I got a terrific comment from Bart Vandyck about his prompt which has just about everything you would want. I too have a “kitchen sink” prompt, that is to say, one with the proverbial “everything but the kitchen sink”. Or you might consider this an extreme…
PowerShell ISE New Function
Yesterday I showed how to add a menu choice to the PowerShell ISE to insert the current date and time. Today I have something even better. At least it’s something I’ve needed for awhile. I write a lot of advanced functions in PowerShell. I’m often cutting and pasting from previous scripts and generally not being…
PowerShell ISE Insert DateTime
I still don’t leverage the PowerShell Integrated Script Editor (ISE) as much as I should. But after reading a few recent entries from The Scripting Guys on inserting help and headers into a script, I thought I’d dig in a little more. I’ve a few things to share but today I want to show you…