PowerShell Team

Automating the world one-liner at a time…

Latest posts

Jun 29, 2007
Post comments count 0
Post likes count 0

No PowerShell at LISA

Steve Lee

If you were thinking about attending a PowerShell talk at LISA (Large Installation System Administration conference), the answer is NO. Someone suggested that the attendee's of this conference would love a PowerShell talk so I submitted my Monad Manifesto as a draft with the thinking was that I would bring that paper up to date, provide more details etc. I'd be hard pressed to think of a topic more relevant to people managing large systems so I thought it would be a good fit. Sadly, the paper got turned down and the reject notice (below) provided feedback from various reviewers. I thought you might enjoy these a...

Jun 29, 2007
Post comments count 0
Post likes count 0

Free PowerGadgets

Steve Lee

That got your attention didn't it? The guys over at PowerGadgets have introduced a PowerGadgets MVP Program. It sounds like it is modeled a bit after the Microsoft MVP program where if you are influential within the community, you get treated really nice (read free software). They are making the program available to IT pros, software vendors, UG leaders and technology previewers – that is a pretty wide net. You can apply for a free copy HERE. If you haven't see PowerGadgets – it is definitely worth looking into. The look on people's faces the first time you show them a command line piping object into a PowerGad...

Jun 28, 2007
Post comments count 0
Post likes count 0

Do You Really Want To Use –EQ?

Steve Lee

Sebastien posted a cool simple script HERE which effectively does a reverse lookup on aliases. Here is the code: function Get-AliasShortcut([string]$CommandName) { ls Alias: | ?{ $_.Definition -eq $CommandName } } Set-Alias gas Get-AliasShortcut Notice that he used –EQ. Whenever you find yourself using –EQ, ask yourself if that is really want you want. You might be cheating yourself out of a ton great stuff. Consider changing the -EQ to -MATCH That would allow you to do: PS> Get-AliasShortcut child CommandType Name Definition ----------- ---- ---------- Alias gci Get-ChildItem Alias ls Get-ChildItem...

Jun 28, 2007
Post comments count 0
Post likes count 0

Heterogeneous Job Scheduling With PowerShell

Steve Lee

JAMS (Job Access & Management System) is a commercial software product that provides job scheduling for Windows, OpenVMS, UNIX and Linux systems. It now provides full PowerShell support. What does that mean? They say that they support PowerShell in three ways: JAMS-specific PowerShell host to tightly control scripts under JAMs. I don't know what they are doing specifically but it makes sense that a job scheduler could provide a lot more control over the execution if it hosted the PowerShell engine directly. JAMS commands to control QUEUES, ENTRYs, VARIABLES, TRIGGERS, TIMEs etc. They did a good job adhering to ...

Jun 28, 2007
Post comments count 0
Post likes count 0

Heterogeneous Job Scheduling With PowerShell

Steve Lee

JAMS (Job Access & Management System) is a commercial software product that provides job scheduling for Windows, OpenVMS, UNIX and Linux systems. It now provides full PowerShell support. What does that mean? They say that they support PowerShell in three ways: JAMS-specific PowerShell host to tightly control scripts under JAMs. I don't know what they are doing specifically but it makes sense that a job scheduler could provide a lot more control over the execution if it hosted the PowerShell engine directly. JAMS commands to control QUEUES, ENTRYs, VARIABLES, TRIGGERS, TIMEs etc. They did a good job adhering to ...

Jun 28, 2007
Post comments count 0
Post likes count 0

Partying with Join-Path

Steve Lee

Did you realize that you can Join-Path can work on multiple items? PS> Get-Help Join-Path -parameter *path -path Specifies the main path (or paths) to which the child-path is appended. Wildcards are permitted. The value of Path determines which provider joins the paths and adds th e path delimiters. The Path parameter is required, although the paramet er name (-path) is optional. Required? true Position? 1 Default value N/A - The path must be specified Accept pipeline input? true (ByValue, ByPropertyName) Accept wildcard characters? true -childPath Specifies the elements to append to the...

Jun 27, 2007
Post comments count 0
Post likes count 0

Hosting Windows PowerShell Part 2 of 3

Steve Lee

David Aiken is at it again. In his latest segment of the DFO show – Hosting Windows PowerShell Part 2, he converts the code he produced in Part 1 to use strong types by casting the PSObject.BaseObject. From there, he add the ability to select one the SERVICEs he displays and then to Stop it using the Stop-Service cmdlet. In Part 1, he showed how you can pass in a string and run it. Here he shows how you can create a Command object and programmatically add parameters to it and then execute that command in a pipeline. He then shows how the program will break if the command or script you run tries to interact with ...

Jun 26, 2007
Post comments count 0
Post likes count 0

Surfing the Web the PowerShell Way

Steve Lee

I spend a lot of my time in the command line (surprised?). That said, I also spend a lot of time surfing the web. Here is a script that I wrote that lets me surf the web from PowerShell: UrlTemplateMap = @{ "bs" = "http://blogsearch.google.com/blogsearch?hl=en&q={0}&ie=UTF-8&scoring=d" "dr" = "http://drudgereport.com" "gtr" = "http://www.google.com/language_tools?hl=en" # GOOGLE TRANSLATE "verb" = "http://msdn2.microsoft.com/en-us/library/ms714428.aspx" "v" = "http://msdn2.microsoft.com/en-us/library/ms714428.aspx" "ps" = "http://blogs.msdn.com/powershell/default.aspx" } $Script:OutIE = $Null function O...

Jun 26, 2007
Post comments count 0
Post likes count 0

Why Isn’t PowerShell.exe Authenticode Signed?

Steve Lee

This question came up on our internal forum last week, and Jeffrey, knowing of my sharp wit and keen hand for prose, asked me to blog about the answer. So here goes: It is Authenticode signed. Just in a special way. The Windows PowerShell update packages each contain a catalog (.cat) file, which has a list of files in the package and a hash of each file. Since the .cat file is Authenticode signed, the chain of trust can be verified by checking the signature on the .cat file, then comparing the hash the catalog lists for PowerShell.exe to a newly computed hash of PowerShell.exe. If the signature is valid and...