Monthly Archives: December 2009

Online PowerShell help

One of the reasons I dump the file files to text files is that I am frequently in a position of being on a customer site without direct Internet access.  If I have the files available then I can solve … Continue reading

Posted in PowerShell V2 | Leave a comment

Module Help Files

The use of modules to supply PowerShell based functionality in Windows 7Windows 2008 R2 makes accessing the help files a little bit problematic. We have to have the module loaded to access the file.  Sometimes I want to think through … Continue reading

Posted in PowerShell V2 | Leave a comment

Access Functions

I have put the module of Access functions I’ve been blogging about over the last few weeks onto my SkyDrive at http://cid-43cfa46a74cf3e96.skydrive.live.com/browse.aspx/PowerShell%20Scripts/AccessFunctions The usual warnings apply. This is a work in progress and subject to change.  All scripts, and the … Continue reading

Posted in PowerShell V2 | 4 Comments

Proxy for import-module

I do quite a lot with modules as you can tell from my posts over the last few months and have bit a fair collection of modules. One issue I find when loading a module is that I can’t always … Continue reading

Posted in PowerShell V2 | Leave a comment

WMI migration

In case you were wondering why the WMI based posts seem to have dried up – I have opened a new blog http://itknowledgeexchange.techtarget.com/powershell/ Just for PowerShell and WMI. I figure there is enough subject matter in the topic to support … Continue reading

Posted in PowerShell and WMI | Leave a comment

Delete Access Table

This times lets go mad and delete a whole table. 001002003004005006007008009010011 function Remove-AccessTable {[CmdletBinding(SupportsShouldProcess=$true)]param (    [string]$table,    [System.Data.OleDb.OleDbConnection]$connection)    $sql = "DROP TABLE $table "    $cmd = New-Object System.Data.OleDb.OleDbCommand($sql, $connection)        if ($psCmdlet.ShouldProcess("$($connection.DataSource)", "$sql")){$cmd.ExecuteNonQuery()}} Again we use the SupportsShouldProcess – have to love the amount of functionality we get for one line of … Continue reading

Posted in Powershell | Leave a comment

Delete an Access Column

We have seen how to add a column to our access database – what about removing a column? 001002003004005006007008009010011012 function Remove-AccessColumn {[CmdletBinding(SupportsShouldProcess=$true)]param (    [string]$table,    [string]$column,    [System.Data.OleDb.OleDbConnection]$connection)    $sql = "ALTER TABLE $table DROP COLUMN $column"    $cmd = New-Object System.Data.OleDb.OleDbCommand($sql, $connection)        if ($psCmdlet.ShouldProcess("$($connection.DataSource)", "$sql")){$cmd.ExecuteNonQuery()}}   We use the SupportsShouldProcess=$true to get the … Continue reading

Posted in Powershell | Leave a comment