What’s up with PSBASE, PSEXTENDED, PSADAPTED, and PSOBJECT?

“Brandon Shell” asked:> I have seen adding psbase to alot of things “fixes” problems… What is this > psbase (thingy) and why do I have to use it? > There are lots of different object & data technologies in the world, each with their own particulars.  Most of us never care about those particulars, we want… Read more

Turning the dial to 11 with Custom TypeConverters

If you are the sort of bloke that likes to turn the dial to 11, you should check out Abhishek’s recent blog entry on Custom TypeConverters: http://abhishek225.spaces.live.com/Blog/cns!13469C7B7CE6E911!191.entry Much of the power of Windows PowerShell comes from the type coercion capabilities of our ObjectFlow engine.  This is what allows PowerShell to eliminate tons of low-class, impedance-mismatch programming minutia… Read more

Why do I sometimes get different types?

PSMDTAG:FAQ: Why do I sometimes get different types or different behaviors? PSMDTAG:FAQ: When I pipe a heterogenous set of objects to an cmdlet that expects a homogenous stream – what happens and why? In our newgroup ( Microsoft.public.Windows.PowerShell ), Alex A asked these questions with the following example: cd c:\temp$( gci ; gci hkcu:\ )… Read more

Flexible pipelining with ScriptBlock Parameters

PSMDTAG:FAQ: How can I pipeline data to a parameter which does not accept pipeline input?PSMDTAG:FAQ: What are ScriptBlock Parameters? One of the foundation concepts of Windows PowerShell is pipelining objects instead of text.  What happens is that when an upstream command generates an object, the PowerShell engine examines the data requirements of the next pipeline… Read more

More – How does PowerShell formatting really work?

<Edited 7/2/2006 with tags and categories>PSMDTAG:FAQ: Why doesn’t output expand when I expand the width of the console?PSMDTAG:FAQ: Why doesn’t output expand when I use -noElements on GROUP? Consider the example: PS> gps |group company Count Name                      Group—– —-                      —–   34 Microsoft Corporation     {alg, CcmExec, ctfmon, dsamain…}    1 Adobe Systems Incorpor… {apdproxy}    2 Alps Electric Co., Ltd.  … Read more

Programmatic way to get valid string values for a parameter

<WIZARD WARNING>  ISVs and Tool vendors may find this important, Advanced users may find this interesting, Casual users may want to skip this. Someone asked me if there was a programmatic way to tell what the legal values for a string parameter to a cmdlet was.  The example was OUT-FILE -ENCODING xxx Out current help doesn’t… Read more

Invoking PowerShell with complex expressions using Scriptblocks

<WIZARD WARNING> First a reminder:  when you are in PowerShell (formerly knows as Monad), you can run anything you want out-of-process using the construct: PowerShell {Scriptblock} The great example of this is PS> #RUN EVERYTHING IN PROCESSPS> get-process |where {$_.handles -ge 900} |sort handles Handles  NPM(K)    PM(K)      WS(K) VM(M)   CPU(s)     Id ProcessName——-  ——    —–      —–… Read more

Exposing the Power of .NET in a Admin-friendly way

One of our primary goals for Monad was to:  “Expose the power of .NET in an Admin-friendly way”.  The challenges of systems administration are large and growing at the same time organizations are under ever more pressure to reduce costs and do more with less.  That was true 10 years ago, it is true now,… Read more

Finding out what determines which properties are displayed

MoW, a Monad newsgroup regular, asked why only the Caption, Name and PeakUsage properties were displayed from the command “get-WMIObject Win32_PageFileUsage” while the output object had a lot more properties. I think it is worth it to explain in details how to find out which properties are displayed.First, I would look at which view defined… Read more