Hello PowerShell world!

May 12, 2006

Why yet another blog?

I'm excited by the potential of Windows PowerShell for professional administrators and power users to get a handle on their Windows computers and plan to use this blog to describe, explore, comment and pontificate about any issue relating to Windows PowerShell that interests or puzzles me.

And, of course, I plan to post and discuss some PowerShell scripts that hopefully will be useful to people who are learning about Windows PowerShell and learning how to use it.

PowerShell is different in many significant ways from other command line shells and scripting languages. So I ought to have plenty to write about over the coming months.

Advertisements

2 Responses to “Hello PowerShell world!”

  1. Jeffrey Snover Says:

    I’m looking forward to hearing about your experiences with PowerShell.

    Cheers!
    Jeffrey Snover

  2. BGates Says:

    In a search and replace substring script involving multiple files, I have concurrency issues. Here’s the script:

    (get-childitem . -recurse -force -include “Root”) |
    foreach-object -process
    {get-content $_ |
    select-string -pattern 2001 |
    foreach-object {$_ -replace “2001”, “2003”} |
    set-content $_
    }

    The intent is to search the folders recursively to
    find files named “Root”. For each found file,
    get the single line out and replace the occurence
    of the string “2001” with “2003”.
    Finally, write out the content back to the same file.

    An example (Example 3) of a similar operation is given
    in “get-help set-content -detailed”.

    Instead, I get “… because it is being used by another process …”.

    Is there a better way?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: