PowerShellStation.com update

I just changed the syntax highlighting used by the site (to SyntaxHighlighter Evolved). One reason is that it’s much easier to use.

I have tried to go through the older posts and update the markup to include the proper codes to highlight using the new plugin. If you notice one that doesn’t look quite right, let me know.

Mike

Best Practices Update and some Scripting Games thoughts

Just a quick note to let you know that I haven’t given up on writing about PowerShell best practices. A few things which have derailed my thinking. My first “best practice” I thought was a no-brainer. After I wrote it I got thinking about what actual benefit there was to sticking to single-quotes rather than …

Continue reading ‘Best Practices Update and some Scripting Games thoughts’ »

PowerShell Best Practice #1 – Use Single Quotes

I’m going to kick off this series with a no-brainer. In PowerShell, there are 2 ways to quote strings, using single-quotes (‘) or double-quotes (“). This is probably not a surprise to you if you’ve seen PowerShell scripts before. A “best practice” in PowerShell is that you should always default to using single-quotes unless you …

Continue reading ‘PowerShell Best Practice #1 – Use Single Quotes’ »

A Remoting Issue with PowerShell 3 Beta

I’ve been doing some thinking about PowerShell Remoting for a project at work and realized that I hadn’t ever set up remoting on my “home” laptop. I’m not in a domain, so remoting configuration is a bit different. In any case, I would be using the same machine as source and target of the remoting …

Continue reading ‘A Remoting Issue with PowerShell 3 Beta’ »

Speeding up Powershell Webcast by Dr. Tobias Weltner

If you’ve done much looking around, you know that there’s an awful lot of great information about PowerShell available on the web. The community that has formed around this product is one of its strengths. You’re probably familiar with the name Tobias Weltner. His Master-PowerShell e-book has long been a resource that I’ve turned to …

Continue reading ‘Speeding up Powershell Webcast by Dr. Tobias Weltner’ »

Importing Modules using -AsCustomObject

I recently got thinking about the -AsCustomObject switch for the Import-Module cmdlet. I have seen it several times in discussions of implementing “classes” in PowerShell. Here’s a typical (i.e. trivial) example: With that module, we can do the standard module stuff: Ok, that was way too basic. Here’s something a lot closer to the topic …

Continue reading ‘Importing Modules using -AsCustomObject’ »

Aggregation In PowerShell (and another pointless function)

I’ve been doing a lot of thinking about “idiomatic PowerShell” since my last post and my thinking led me to an idea that I haven’t actually used, but seems like the kind of thing that people would do in PowerShell. If I were writing a script that needed to get a “bunch of things” from …

Continue reading ‘Aggregation In PowerShell (and another pointless function)’ »

PowerShell’s Problem with Return

I think that PowerShell is a fairly readable language, once you’re used to its unique features. Naming functions (cmdlets) with an embedded hyphen, using -eq instead of the equals sign (and similarly for other operators) and not using commas to delimit parameters in a function call (but using them in a method call) are all …

Continue reading ‘PowerShell’s Problem with Return’ »