Monthly Archives: August 2009

PowerShell v2 help file

In PowerShell v2 we get a nice graphical help system that includes the cmdlets, the about files and and the User and Getting Started Guide. It doesn’t include the help for the optional modules though which is a pity. The … Continue reading

Posted in PowerShell V2 | Leave a comment

Word Add a table

There seems to be two types of paragraph I create in Word documents – text or tables.  Lets start by adding a table. 001002003004005006007008009 function Add-Table {    param (        [int] $row = 2,        [int] $col = 5    )    $global:paragraph = $doc.Content.Paragraphs.Add()    $range = $paragraph.Range    $global:table = $doc.Tables.Add($range,$row,$col)}   The function Add-Table takes two integers as … Continue reading

Posted in PowerShell V2 | Leave a comment

Enable Ping

I’ve got a few talks coming up so need to build some more demo machines.  One thing I like to be able to do in the demo environment is ping between machines – sometimes necessary when testing things out but … Continue reading

Posted in Powershell | Leave a comment

Module path

PowerShell v2 has 2 default locations for modules – in the install directory and in your profile.  My demo laptop is set to dual boot Windows 7 & Windows 2008 R2.  It would make sense to only maintain one set … Continue reading

Posted in PowerShell V2 | Leave a comment

Word New Document change

I started experimenting with the New-WordDocument function and realised I needed to change it to make the variables usable across the functions. 001002003004005 function New-WordDocument {    $global:word = New-Object -ComObject Word.Application    $word.Visible = $true    $global:doc = $Word.Documents.Add() }   Simple change is to make the variables global in scope.  This means … Continue reading

Posted in PowerShell V2 | Leave a comment

Word New Document

Lets add another function to our module for working with Word.  Its time to create a new word document 001002003004005 function New-WordDocument {    $word = New-Object -ComObject Word.Application    $word.Visible = $true    $Word.Documents.Add() | Out-Null}   Create the object for word as before.  Set the visible property to true (we can’t … Continue reading

Posted in PowerShell V2 | Leave a comment

Word Autocorrect

If you have been following this blog for awhile you will know that I build and rebuild machines on a reasonably frequent basis.  One drawback to this that I have to keep re-creating the Autocorrect entries.  I do a lot … Continue reading

Posted in PowerShell V2 | Leave a comment

File download problem

If you are using the Office 2010 TP and try to download a word document through Internet Explorer you end up in a continuous loop of being asked fro credentials.  The download site won’t recognise your local credentials so you … Continue reading

Posted in PowerShell V2 | 1 Comment

TCP Ports

I came across this post http://www.expta.com/2009/08/name-that-port.html that gives the well known service for a TCPUDP port.  Useful script but its written in VBScript.  Needs to be in PowerShell. 001002003004005006007008009010011012013014015 param ([int]$port)$data = @’1 = TCP Port Service Multiplexer2 = Management Utility3 = Compression … Continue reading

Posted in PowerShell V2 | 1 Comment

Windows 2008 R2 RTM

It hasn’t had the same level of fanfares but Windows Server 2008 R2 RTM is available for download from TechNetMSDN.  I’ll be converting my test domain over the next few days and reporting on all the PowerShell goodies we get … Continue reading

Posted in Uncategorized | Leave a comment