Browse by Tags

Tagged Content List
  • Blog Post: Another Holiday Gift from the PowerShell Team: PowerShell 3.0 CTP2 - Getting Started with Windows PowerShell Workflow

    After delivering the Thanksgiving Gift this year, it’s time for a Holiday Gift …. No not as big as the one we had about 3 years ago …!! Today, we published the “Getting Started with Windows PowerShell Workflow” document on the CTP2 download page , just look for “WMF3...
  • Blog Post: Update-TypeData, ISE CTP3 vs ISE RC, and Teched2009 Demos

    There were quite a few name changes in the ISE Object Model from CTP3 to RC Using Update-TypeData, we can achieve some parity between the two We can add aliases to the CTP3 version to make it look like the RC Version For example, <Name>System.Management.Automation.Host.PSGHost</Name>...
  • Blog Post: V2 Quick Tips: Finding Extra Outputs From Your Script

    One of the nifty features of functions in PowerShell is that they can return as many results from as many places as you’d like.  In fact, any method or cmdlet that would give you an output if you try it on the command line will also return values from a function.  While this can give you a...
  • Blog Post: V2 Quick Tip: Starting a new elevated process from a PowerShell script

    One of the systems administration hurdles of the post-Vista world is figuring out how to make a script run as an administrator. In PowerShell V2, using the Start-Process cmdlet, this is a one liner that will get the job done: Start-Process "$psHome\powershell.exe" -Verb Runas -ArgumentList...
  • Blog Post: Do PowerShell Demos in the ISE

    Jeffry Snover and many other have used Start-Demo in powershell.exe http://blogs.msdn.com/powershell/archive/2007/03/03/start-demo-help-doing-demos-using-powershell.aspx Continuing the tradition, we now have ISEDemo.psm1 To use it, start ISE and run Import-Module ISEDemo.psm1 #(attached) Start...
  • Blog Post: V2 Quick Tip: Monitoring Performance Counters with PowerShell

    I just got a ping on our internal discussion list about how to get at the Performance counters in PowerShell.  In V2, we've got some nifty cmdlets to help read performance counters. Here are a few of quick one liners to get you started: # List all of the performance counters you can monitor Get...
  • Blog Post: Differences between the ISE and PowerShell console

    Here is a collection of differences between the PowerShell_ise.exe and PowerShell.exe, as well as workarounds and suggestion if you need them (assuming we have them :)) Limited support for interactive console apps, try cmd.exe, then try cmd.exe /k cmd.exe /c dir still works though, and more...
  • Blog Post: Image Manipulation in PowerShell

    The other week, I showed a Get-ProgID function that I used to help someone at Microsoft Research find a good object to talk to images. A few comments jumped to one of the possible solutions, which is to use the .NET Drawing assembly (which I have to load first). I wanted to be reasonably sure that the...
  • Blog Post: Get closure with GetNewClosure

    Have you ever created scriptblocks on the fly, say in a foreach loop, and they totally mess up because they all have the same value? This is something sort of advanced, and typically used when you’re proxying an object. The most basic example would be, taken from ( http://www.powershellcommunity...
  • Blog Post: Tied Variables in PowerShell

    With Add-Type and $executioncontext you can add special varibles that have tied values. I made $random, and $now add-type @" using System; using System.Management.Automation; public class RandomVariable : PSVariable { Random r; public RandomVariable () : base("Random", 0, ScopedItemOptions.ReadOnly...
  • Blog Post: How to Create an Object in PowerShell

    Today someone in Xbox Live Operations (the folks that keep xBox Live alive and well) pinged me with a simple question about PowerShell with a complicated answer: “How do I create a class in PowerShell?” There’s two scenarios I find where people want classes.  The first (and most...
  • Blog Post: Diff between Windows PowerShell versions

    PowerShell MVP Oisín Grehan has done a really good job in getting the diff between PowerShell releases. V1 and CTP3 http://www.nivot.org/2009/02/04/DifferencesBetweenPowerShell10RTMAndPowershell20CTP3Win7Beta.aspx CTP2 and CTP3 http://www.nivot.org/2008/12/23/PowerShell20CTP3HasArrived.aspx ...
  • Blog Post: Getting Alternate Streams (Verbose, Progress, Debug) with the PowerShell API

    Dozens of people could write dozens of books on all of the cool stuff we improved in V2 of PowerShell.  One of the nice little things we did was give a more understandable API than Pipeline (which is the class you can use to invoke code from C# in V1).  This API is called the PowerShell API...
  • Blog Post: Debugging PowerShell Script Using the ISE Editor

    Hi writers and consumers of buggy scripts. This post explains the basics of the Graphical Debugger in the ISE. There’s a lot of good stuff, with some tips and tricks. The debugger support got the cmdlets and user interface. The cmdlets include Enable/Disable/Get/Set/Remove-PsBreakpoint and Get-PsCallStack...
  • Blog Post: How To Make Your Own Module Repository

    Andy Schneider (from Get-PowerShell.com ) recently asked me how he could make sure that everyone at Avanade could get a consistent set of modules. I run into a somewhat similar problem here at Microsoft, where I want to take scripts I've built to work with internal applications and make them easy for...
  • Blog Post: Interactive remoting in CTP3

    Today let's talk about one of the cool new features of Windows PowerShell V2 - Interactive Remoting. Let’s start with an example: PS> $env:COMPUTERNAME # Check local computer name. VLADIMIA64 PS> Enter-PSSession Vladimia06 # Remote to other computer. [vladimia06]: PS C:\Users\Vladimia\Documents>...
  • Blog Post: Copy console screen to system clipboard

    In the previous example we learned how to create a colorized copy of console in HTML and RTF format. However, the output of these scripts cannot be readily used for pasting into web or word processing applications. To insert it into your article in MS Word format, you need several steps: generate RTF...
  • Blog Post: Finding a URL For File Transfer Cmdlets

    I just posted a blog about our new File Transfer Cmdlets in which I artfully dodged a difficult question: How do you get the URL to do the file transfer? Sometimes you are going to have it but other times you’ll go to a website and it can be bloody impossible to find the URL that you need to download...
  • Blog Post: Transferring (Large) Files Using BITs

    Have you had a file copy fail? Does that drive you crazy or what? How about when it is a REALLY big file and it takes a couple of hours and JUUUUUST before it finishes something happens to interrupt the transfer and you have to start all over again. Does that make you want to shove a sharpened #2 pencil...
  • Blog Post: Test-PSCmdlet

    Everyone needs to get good with Advanced Functions – this is the easiest path to the best semantics for everyone. In previous posts we’ve shown how you can add a few simple attributes and get a TON of stuff for free. There is a LOT more to advanced functions. You can go VERY VERY far with advanced functions...
  • Blog Post: PS> Dir –A D The Screencast

    I decided to experiment with a screencast. This is my first and I have no idea what I’m doing so please forgive me if it sucks. I’d like to know whether you find this format useful or not and then specific feedback about how to make the screencast better (e.g. I recorded it at 1024x768 - is that good...
  • Blog Post: Extending and/or Modifing Commands with Proxies

    There are so many powerful features in V2, it is hard to know where to begin. This one is going to blow to top of your head off when you understand what it enables you to do. In this blog, I talk about Proxy Cmdlets which is the ability for one Cmdlet to call another. You could always do this but...
  • Blog Post: Diagnosing Here-Strings With PowerShell_ISE

    James Brundage posted a blog entry How To Write a Console Application in PowerShell with Add-Type which used a here-string.   One user (lcr) copied and pasted the text and got the following error: Unrecognized token in source text. At line:1 char:72 + Add-Type -OutputType ConsoleApplication...
  • Blog Post: How To Write a Console Application in PowerShell with Add-Type

    Windows PowerShell CTP3 has a lot of very cool things.  CTP2 introduced the Add-Type cmdlet, which allowed you to dynamically compile C# in PowerShell.  It was actually possible to use the CompilerParameters to Add-Type to make a console application, but it wasn't particularly easy.  In...
  • Blog Post: A Module to Create Modules and Advanced Functions

    [1/3/09 Update - the original link to the attachment containing this code was broken but is now fixed. Sorry. jps] It is hard to overstate how important Modules and Advanced Functions are. If you are a PowerShell user - you need to take the time to learn these new mechanisms and use them as your first...
Page 1 of 2 (44 items) 12