Monthly Archives: July 2008

Subject swap

Due to unforeseen circumstances we have had to swap the subject of tonight's User Group Live Meeting.  I'm doing a session on administering IIS 7 from PowerShell showing and contrasting the various options.  Marco's session on the net cmdlets is postponed until next month

 

Share this post :

 

Technorati Tags: ,

UK PowerShell User Group Live Meeting

Date: 31 July  2008

Time: 7pm BST (GMT+1)

Marco Shaw, PowerShell MVP will be talking about /n software netcmdlets

Join the meeting.
Audio Information
Computer Audio
To use computer audio, you need speakers and microphone, or a headset.
First Time Users:
To save time before the meeting,
check your system to make sure it is ready to use Microsoft Office Live Meeting.
Troubleshooting
Unable to join the meeting? Follow these steps:

  1. Copy this address and paste it into your web browser:
    https://www.livemeeting.com/cc/usergroups/join
  2. Copy and paste the required information:
    Meeting ID: JQ5754
    Entry Code: 6M+7p&KhN
    Location: https://www.livemeeting.com/cc/usergroups

If you still cannot enter the meeting, contact support

Notice
Microsoft Office Live Meeting can be used to record meetings. By participating in this meeting, you agree that your communications may be monitored or recorded at any time during the meeting.

 

Share this post :

 

Technorati Tags: ,

PowerShell Event Registration Open

There will be a TechNet PowerShell event in Birmingham (UK) on the afternoon of 14 October 2008.  Registration is open at http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032383908&Culture=en-GB

 

Share this post :

 

Technorati Tags:

Blog Mirror

This blog is now mirrored on http://msmvps.com/blogs/RichardSiddaway/Default.aspx  Evidently spaces.live.com is blocked by some firewalls so the blogs cannot be accessed.  msmvps.com should be accessible.

 

 

 

Technorati Tags: ,

PowerGUI – intellisense

One nice touch I found with the PowerGUI editor recently - if you start to type a path in the filesystem there is an intellisense popup to enable you to select the folder and subfolders.  Very useful and saves typing and mistakes.  Not sure when this feature first appeared but it is good.

 

Share this post :

 

Technorati Tags:

PowerShell Event

There will be a TechNet PowerShell event in Birmingham (UK) on the afternoon of 14 October 2008. Registration details will follow next week when they are available.

If there is sufficient interest we will look at running a PowerShell User Group event afterwards

 

Share this post :

 

Technorati Tags:

PowerGUI 1.5.1 RTM

PowerGUI has released version 1.5.1  - download from http://www.powergui.org/downloads.jspa

Details from http://dmitrysotnikov.wordpress.com/2008/07/25/powergui-151-rtms/

 

Share this post :

 

Technorati Tags:

String expansion

One of the nice features of PowerShell is string expansion.  Put a variable in the middle of a double quoted string (single quoted strings take the contents literally and don't expand) and the variable is substituted into the string when it is evaluate.

Example

PS> $a = "a"
PS> $b = "b"
PS> $c = "c"

PS> "$a"
a

PS> "$a$b$c"
abc

Define three string variables as shown and then try substituting them into the string.  It works as shown. This seems to break down when an underscore character gets involved.

PS> "$a_"

PS> "$a$b"
ab
PS> "$a$b_"
a
PS> "$a_$b"
b
PS> "_$a$b"
_ab
PS> "_$a$b$c"
_abc
PS> "$a_$b$c"
bc
PS> "$a$b_$c"
ac
PS> "$a$b$c_"
ab
PS> "_$a$b$c"
_abc

Put the underscore character after the variable and the variable is ignored. Put it before a variable and it works.

Use an escape character

PS> "$a`_$b"
a_b
PS>

and it works.

So the underscore character has the effect of nullifying a variable.  I've not seen this before and if anyone has an explanation I'd love to hear it.  I've not been able to find an explanation by checking out the usual sources. Maybe I'm missing something here but in the mean time be careful when using _ characters like this.

 

Share this post :

 

Technorati Tags:

User Group Meeting – New Date

Apologies but we need to move the Live Meeting hosted by the UK PowerShell User group to 31 July.

Marco Shaw, PowerShell MVP, will be talking about /n software NetCmdlets

Webcast will be 1 hour starting at 7pm UK time (GMT+1)

If you are not a member of the user group leave me a comment with contact  details or email me at powershell-uk {At} hotmail [dot] co (dot) uk

 

Share this post :

 

Technorati Tags: ,

WMI Classes

In this post http://richardsiddaway.spaces.live.com/blog/cns!43CFA46A74CF3E96!1525.entry I talked about the difference between Get-WmiObject and [WmiClass].  I've had a comment left asking "But how do you know that there is Win32_Process inside this class?!?!?"

This question could have several meanings.  What I did in the post was a bit of a circular argument as I started with Win32_Process deliberately - mainly because it and notepad should be available to everyone working with PowerShell.  So I know that the class is Win32_Process because thats how I set it up to be.

WMI classes are not the same as .NET classes.  WMI is COM based. We can access it through the System.Management.xxxx  .NET classes which is what we are working with when we use the PowerShell WMI commands.

In the wider context how do I know that windows processes are represented by Win32_Process. Partly its experience - I've been working with Windows and WMI for a long time.  How long did you ask?  Hmmmm, I could tell you but...........

The other way to discover what the WMI classes represent is to dig into them.

Get-WmiObject -List

will give you a list of WMI classes in the cimv2 namespace which is where most of the common Windows admin WMI classes sit.  The names are often self describing. Have a try of them with Get-WmiObject - its read only so you won't damage your system.

Other methods include:

- use wmiexplorer from http://thepowershellguy.com/blogs/posh/archive/2007/03/22/powershell-wmi-explorer-part-1.aspx

- PowerShell scriptomatic from http://www.microsoft.com/technet/scriptcenter/tools/psomatic.mspx

- WMI Reference information from http://msdn.microsoft.com/en-us/library/aa394572.aspx

Hope this helps

 

Share this post :

 

Technorati Tags: ,