header image

Archive for September, 2009

Word module

Posted by: | September 7, 2009 | No Comment |

I’ve posted a PowerShell module that includes the functions in earlier posts to my skydrive  -   http://cid-43cfa46a74cf3e96.skydrive.live.com/browse.aspx/PowerShell%20Scripts Enjoy Technorati Tags: PowerShell v2,Word,Module

under: PowerShellV2

Unblocking files

Posted by: | September 5, 2009 | No Comment |

When I download files from the Internet to Vista or Windows 7 the file is blocked and I can’t execute it until its unblocked. This is especially annoying with zip files because if I unzip them all the contents are blocked. I have been meaning to do something in PowerShell for this and finally got […]

under: Modules, PowerShellV2

Codeplex AD Replication Module

Posted by: | September 4, 2009 | No Comment |

The other codeplex project that caught my eye was a brand new one to create a PowerShell module to manage AD replication.  This one will be very useful and one I will be using a lot. There is still time for suggestions as to content for this project – see http://adreplicationmodule.codeplex.com/ Technorati Tags: PowerShell v2,Active […]

under: Active Directory, Modules, PowerShell and Active Directory, PowerShellV2, Windows Server 2008

Codeplex PowerShell Configurator

Posted by: | September 4, 2009 | 1 Comment |

I was looking at codeplex (Microsoft’s Open Source site) and decided to do a search for projects relating to PowerShell. 161 projects were returned.  The first 110 had an obvious PowerShell connection.  This is a tremendous number and really does demonstrate the strength of the PowerShell community. One project that caught my eye was James […]

under: PowerShellV2, Windows Server 2008

Word Add text

Posted by: | September 3, 2009 | No Comment |

Keeping on with our look at Word we need to able to add text to the documents we are creating. 001 002 003 004 005 006 007 008 009 010 011 function Add-Text {     param (         [string] $style = "Normal",         [string] $text      )     $global:paragraph = $doc.Content.Paragraphs.Add()     $range = $paragraph.Range     $Paragraph.Range.Text = $Text     $Paragraph.Range.Style = $Style     $Paragraph.Range.InsertParagraphAfter() }   Add a paragraph […]

under: PowerShellV2

Word add data to a table

Posted by: | September 2, 2009 | No Comment |

We created a table in a recent post.  This time round we add some data to the table.   001 002 003 004 005 006 007 008 009 function Add-TableData {     param (         [int] $row = 1,         [int] $col = 1,         [string] $text     )     $table.Cell($row,$col).Range.Text = $text     }   The row and column together with the text to enter into […]

under: PowerShellV2

Module Contents

Posted by: | September 1, 2009 | No Comment |

I’ve been writing a few modules recently and sometimes forget what I have in each module. Simple way to view the functions each module makes available. 001 002 003 004 005 006 007 Clear-Host Get-Module -ListAvailable | foreach {     Import-Module $_.Name     Get-Command -Module $_.Name | Select Module, Name     Remove-Module $_.Name     "" }   List the available modules and for each one import the […]

under: PowerShellV2

Word Close Document

Posted by: | September 1, 2009 | No Comment |

So far we have created a document and started to add data into the document. 001 002 003 004 005 006 007 008 function Close-WordDocument {     param (         [parameter(Mandatory=$true)]         [string]$file     )     $doc.SaveAs([REF]$file)     $word.Quit() }   We pass a file name in as a parameter. Notice that the parameter is mandatory. If we […]

under: PowerShellV2

Categories