header image

Archive for December, 2009

Online PowerShell help

Posted by: | December 22, 2009 | 1 Comment |

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 the problems. If you have Internet access then the help files are available on line […]

under: PowerShellV2

Module Help Files

Posted by: | December 21, 2009 | No Comment |

The use of modules to supply PowerShell based functionality in Windows 7\Windows 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 what I’m doing and research the help files before I dive into coding.  To make […]

under: PowerShellV2, Windows 7, Windows Server 2008 R2

Access Functions

Posted by: | December 18, 2009 | No Comment |

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 file is alos attached to this post. The usual warnings apply. This is a work in progress and subject to change.  All scripts, and the module, are presented as is with no […]

under: Office 2010, PowerShellV2

Proxy for import-module

Posted by: | December 17, 2009 | No Comment |

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 remember the name of the commands that the module creates. If we use Import-Module -Name […]

under: PowerShellV2

WMI migration

Posted by: | December 14, 2009 | No Comment |

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 a separate site. I will be covering the rest of the PowerShell world from here. […]

under: PowerShell and WMI

Delete Access Table

Posted by: | December 11, 2009 | No Comment |

This times lets go mad and delete a whole table. 001 002 003 004 005 006 007 008 009 010 011 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 […]

under: Uncategorized

Delete an Access Column

Posted by: | December 11, 2009 | No Comment |

We have seen how to add a column to our access database – what about removing a column? 001 002 003 004 005 006 007 008 009 010 011 012 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 […]

under: Office 2010, PowerShellV2

Add a column to an Access Table

Posted by: | December 10, 2009 | No Comment |

Now we have created our Table we can start adding columns 001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020 021 022 023 024 025 026 027 028 029 030 031 032 033 034 035 036 037 038 039 040 041 042 043 044 […]

under: Office 2010, PowerShell original, PowerShellV2

New Access Table

Posted by: | December 10, 2009 | No Comment |

I have already presented a function to create a new access table but I wasn’t very happy with it because we had to supply the full table creation SQL script. I have altered that function so it creates an empty table. We can then use the Add-AccessColumn function to add columns. This also means I […]

under: Office 2010, PowerShell original, PowerShellV2

Creating Objects

Posted by: | December 5, 2009 | 1 Comment |

There is a post on the PowerShell Team blog about using New-Object – http://blogs.msdn.com/powershell/archive/2009/12/05/new-object-psobject-property-hashtable.aspx The –property parameter discussed in this post is something that I had only come across recently.  In a number of recent posts I have used Add-Type to create a new object by using C# code to define a new class rather […]

under: PowerShell original, PowerShellV2

Older Posts »

Categories