header image

Archive for August, 2009

PowerShell v2 help file

Posted by: | August 31, 2009 | 2 Comments |

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 default locations on the Start Menu for PowerShell are Accessories – Windows PowerShell.  That is […]

under: PowerShellV2

Word Add a table

Posted by: | August 31, 2009 | 1 Comment |

There seems to be two types of paragraph I create in Word documents – text or tables.  Lets start by adding a table. 001 002 003 004 005 006 007 008 009 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 […]

under: PowerShellV2

Enable Ping

Posted by: | August 30, 2009 | No Comment |

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 ping is disabled by the Windows firewall in Windows 2008 & R2. James O’Neill has […]

under: PowerShell original

Module path

Posted by: | August 30, 2009 | No Comment |

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 of files for the modules I write. There is a PowerShell automatic variable that sets […]

under: Uncategorized

Word New Document change

Posted by: | August 30, 2009 | No Comment |

I started experimenting with the New-WordDocument function and realised I needed to change it to make the variables usable across the functions. 001 002 003 004 005 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 they are available across the functions of […]

under: PowerShellV2

Word New Document

Posted by: | August 28, 2009 | No Comment |

Lets add another function to our module for working with Word.  Its time to create a new word document 001 002 003 004 005 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 use it if we can’t see it)  […]

under: PowerShellV2

Word Autocorrect

Posted by: | August 27, 2009 | 1 Comment |

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 of technical writing much of which involves full names of products and correct capitalisation.  I […]

under: PowerShellV2

File download problem

Posted by: | August 24, 2009 | No Comment |

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 for credentials.  The download site won’t recognise your local credentials so you can’t get the documents.  You do however get to see the URL from where the […]

under: PowerShellV2

TCP Ports

Posted by: | August 20, 2009 | No Comment |

I came across this post http://www.expta.com/2009/08/name-that-port.html that gives the well known service for a TCP\UDP port.  Useful script but its written in VBScript.  Needs to be in PowerShell. 001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 param ([int]$port) $data = @’ 1 = TCP Port Service Multiplexer 2 = Management Utility […]

under: PowerShell original

Windows 2008 R2 RTM

Posted by: | August 16, 2009 | No Comment |

It hasn’t had the same level of fanfares but Windows Server 2008 R2 RTM is available for download from TechNet\MSDN.  I’ll be converting my test domain over the next few days and reporting on all the PowerShell goodies we get Technorati Tags: PowerShell v2,Windows 2008 R2

under: PowerShell original

Older Posts »

Categories