Did you ever find yourself knowing that you had written a function but you couldn’t remember which module you put it in? If you have the module imported, you can find out with this: Note that I am defiantly using the “dir” alias for get-childitem even though everyone says not to. I’ll be a rulebreaker …
It’s been a long time (over 2 months) since I last posted. I’ll try to get back into a rhythm of posting at least weekly. Anyway, this is something that occurred to me at work when writing a script. I usually avoid nullable columns, but sometimes date fields make sense to be null (rather than …
The first module-based release of the SQL PowerShell Extensions (SQLPSX) was released recently on CodePlex. It features very handy wrappers for most of the SMO objects used to manipulate SQL Server metadata, SSIS packages, Replication, and (new in the 2.0 release) an ADO.NET module which I wrote based on the code in this post. There’s …
In a recent post , I showed how to get a list of Scheduled Tasks as objects using PowerShell and Import-CSV. In that, I included the following line of code:
In this post, I’ll try to explain why I did that.
There are a few approaches to manipulating scheduled tasks in PowerShell.
* WMI – Useful if you are only going to manipulate them via script. The tasks will not be visible in the control panel applet.
* SCHTASKS.EXE – Works ok, but has a somewhat arcane syntax, and is a text-only tool.
* Task Scheduler API -Best of both worlds, but only on Vista (not XP).