PowerShell Team
Automating the world one-liner at a time…
Latest posts
My Powershell_ISE Profile Part 2
I messed up. First let me remind you that what you have are CTP bits and that CTP bits are subject to change. It turns out that we are tweaking the PowerShell_ISE object model and that the profile I posted does not work with CTP3. I’m sorry for that screw up. You can use the amazing PowerShell_ISE to fix this problem. All you need to do is a search and replace of: CurrentOpenedRunspace.ToolsMenu with CustomMenu Also GoTo-Line is now built into the editor so you should comment that out. I’ll keep it in the script (commented out) so that you can see how it works. I’ve attached the...
My PowerShell_ISE Profile
[UDPATE - the original post had a script which did not work with CTP3 so I've replaced it with the correct version. Apologizes for the screw up. I've updated the attached file as well. - jps] I thought I would share my PowerShell_ISE profile with you. I haven't done anything to clean this up or document it which I should do before sharing but I figured that it would be better to get some good examples out there and then I can clean it up later. # I'm doing a lot of work with Modules these days so I added a drive to make it easy to # get to. New-PsDrive -Name Mod -PSProvider...
Download Windows PowerShell
Available Releases The following releases of Microsoft Windows PowerShell are available for download: Windows Management Framework 3.0 <<-- Latest RTM Release! Windows Management Framework Windows PowerShell 2.0 CTP3 Windows PowerShell 1.0 RTM Related Downloads Deprecated Releases The following releases are no longer available online: Windows Management Framework RC - PowerShell+WinRM+BITS Windows PowerShell 2.0 CTP2 Windows PowerShell 2.0 CTP1
Write-CommandBlogPost
.CmdletName { font-size:large } .CmdletSynopsis { font-size:medium } .CmdletDescription { font-size:medium } .CmdletParameters { font-size:medium } th { font-size: medium; font-style: italic } table { border: 1 } On the PowerShell team, we're big believers in the Virtuous Cycle. As you learn PowerShell more and more, things should get easier and easier to do. Inline help is a great example of the virtuous cycle, because it allows you to write scripts in such a way that they're easy to learn about the same way you learn about most things i...
Experiment with PowerShell V1 Without Installing It
If you are reading this, you probably already use PowerShell but you might know someone that has resisted installing it and trying it out. Thomas Lee posted a blog HERE with a pointer to a Virtual PowerShell lab on TechNet. This allows you to Terminal Serve into a hosted virtual machine and kick the tires. In other words you get to run PowerShell without installing it. Once they are done – they can install it. :-) I didn’t know anything about this but we should try to get them to do this with V2 CTP3 – that would be cool. Thanks for the pointer Thomas! Jeffrey Snover [MSFT] Windows Management Part...
PowerShell V2 – External MAML Help
As you’ve probably picked up by now – Advanced Functions are super important. We've been showing a bunch of scripts that have embedded help using comments and dot-tags. Let me take a second and drill into this. We believe that PS will be used in a wide range of; scenarios: simple one liners; personal ad hoc scripts; scripts you share with your friends; scripts you share with the community; scripts you in your commercial product. It is our goal to have a single mechanism with progressively richer and richer optional features to support this entire range of scenarios. We’ve been showing you the Community H...
PowerShell v2 Pipelining in 73 (make that 53) Characters
I started using Twitter and saw a request from Thomas Lee for help about pipelining in CTP3. The thing about Twitter is that the messages have to be tiny so I wasn’t sure I could answer using it. It turns out I can solve this problem AND give a usage example in 73 characters. Here goes: PS> function t{param([Parameter(ValueFromPipeline=1)]$t);process{$t}};1..10|t 1 2 3 4 5 6 7 8 9 10 Now if you put it into a file (which is actually what Thomas asked for), then it is only 53 characters: PS> cat t.ps1 param([Parameter(ValueFromPipeline=1)]$t);process{$t} PS> cat t.ps1 |Measure -Charact...
Resolve-ShortcutFile
If you're like me, you've got a browser favorites folder that is full of wonderful PowerShell code snippets. Ideally, it would be great to have a way to bring those favorite snippets into PowerShell so that my favorites folder becomes a code library. Doing this presents several challenges. The first (and easiest to solve) is getting the web page the shortcut points to out of the .url file. .url files are in the same sort of format as .ini files (each line has a property name, and =, and the value). So to get the url out of a shortcut file, I simply had to Get-Content on the file, pipe it to Where-Object, look f...
Get-MarkupTag
On my personal blog (Media And Microcode), I've been posting a series called "Scripting the Web", which introduced a function called Get-MarkupTag. Get-MarkupTag is a very handy little function that coerces individual tag elements of a web page into HTML, so you can scrape data from a webpage. I've updated Get-MarkupTag a tiny bit for CTP3, marking the tag name as value from pipeline so I can get multiple tag types from a single document. I'm posting it again here so that a wider audience can make use of it, and so that I can use it in some later blog posts. Since I've already got inline help for the f...