Windows Vista Forums

PowerShell namespace design?

  1. #1


    Alex K. Angelopoulos [MVP] Guest

    PowerShell namespace design?

    While browsing through the namespaces used by PowerShell, I noticed that
    although PowerShell contains subsidiary namespaces, they seem to be a bit
    disorganized. There's a root Microsoft.PowerShell namespace containing
    "miscellaneous bits"; Microsoft.PowerShell.Commands, which contains commands
    but also providers.

    Is this structure intended, or just an artifact of the growth process?




      My System SpecsSystem Spec

  2. #2


    Jeffrey Snover [MSFT] Guest

    Re: PowerShell namespace design?

    This blog explains our namespaces and their usages. It was extensively
    reviewed with the .NET team so while it may or may not be good - it was
    certainly very thoughtful.

    http://blogs.msdn.com/powershell/arc...mespsaces.aspx

    --
    Jeffrey Snover [MSFT]
    Windows PowerShell/Aspen Architect
    Microsoft Corporation
    This posting is provided "AS IS" with no warranties, no confers rights.



      My System SpecsSystem Spec

  3. #3


    Alex K. Angelopoulos [MVP] Guest

    Re: PowerShell namespace design?


    "Jeffrey Snover [MSFT]" <jsnover@microsoft.com> wrote in message
    news:eIf%23mcKzGHA.4648@TK2MSFTNGP04.phx.gbl...
    > This blog explains our namespaces and their usages. It was extensively
    > reviewed with the .NET team so while it may or may not be good - it was
    > certainly very thoughtful.
    >
    > http://blogs.msdn.com/powershell/arc...mespsaces.aspx


    OK. So, paraphrasing the area of my interest a bit and exploring a couple of
    things NOT covered in the blog entry yet -

    Microsoft uses Microsoft.PowerShell.Commands as the namespace for both
    specific cmdlets and specific providers, because those are both about
    commands: providers tend to extend the reach of commands directly.

    A development group such as the PowerShell Community Extensions project
    could then come along and to use a similar pattern so people familiar with
    Microsoft's namespace would be able to understand the extensions namespace
    structure. From what I see, the following look logical; any corrections?

    (1) Assuming that the OEM/Project identification namespace is going to be
    PsCx.PowerShell, the root namespace for PowerShell cmdlets and providers
    would be PsCx.PowerShell.Commands.

    (2) Using the very uniform current scheme for Microsoft's command names, a
    development project would use Verb + Noun + "Command" for specific cmdlets.
    For example, a New-Process cmdlet would have the fully qualified classname
    PsCx.PowerShell.Commands.NewProcessCommand

    (3) Analogously, new providers would use Storetype + "Provider"; for
    example, an XML document provider would be
    PsCx.PowerShell.Commands.XmlProvider



      My System SpecsSystem Spec

  4. #4


    Flowering Weeds Guest

    Re: PowerShell namespace design?


    "Alex K. Angelopoulos [MVP]"

    > A development group such as
    > the PowerShell Community Extensions
    > project could then come along and to use


    Perhaps:

    Framework Design Guidelines
    Conventions, Idioms, and Patterns
    for Reusable .NET Libraries
    http://blogs.msdn.com/brada/archive/...11/450254.aspx




      My System SpecsSystem Spec

  5. #5


    Kenneth Hansen [MSFT] Guest

    Re: PowerShell namespace design?

    Yup, you've got it.
    "Alex K. Angelopoulos [MVP]" <aka@online.mvps.org> wrote in message
    news:uWvegxRzGHA.4392@TK2MSFTNGP04.phx.gbl...
    >
    > "Jeffrey Snover [MSFT]" <jsnover@microsoft.com> wrote in message
    > news:eIf%23mcKzGHA.4648@TK2MSFTNGP04.phx.gbl...
    >> This blog explains our namespaces and their usages. It was extensively
    >> reviewed with the .NET team so while it may or may not be good - it was
    >> certainly very thoughtful.
    >>
    >> http://blogs.msdn.com/powershell/arc...mespsaces.aspx

    >
    > OK. So, paraphrasing the area of my interest a bit and exploring a couple
    > of things NOT covered in the blog entry yet -
    >
    > Microsoft uses Microsoft.PowerShell.Commands as the namespace for both
    > specific cmdlets and specific providers, because those are both about
    > commands: providers tend to extend the reach of commands directly.
    >
    > A development group such as the PowerShell Community Extensions project
    > could then come along and to use a similar pattern so people familiar with
    > Microsoft's namespace would be able to understand the extensions namespace
    > structure. From what I see, the following look logical; any corrections?
    >
    > (1) Assuming that the OEM/Project identification namespace is going to be
    > PsCx.PowerShell, the root namespace for PowerShell cmdlets and providers
    > would be PsCx.PowerShell.Commands.
    >
    > (2) Using the very uniform current scheme for Microsoft's command names, a
    > development project would use Verb + Noun + "Command" for specific
    > cmdlets. For example, a New-Process cmdlet would have the fully qualified
    > classname
    > PsCx.PowerShell.Commands.NewProcessCommand
    >
    > (3) Analogously, new providers would use Storetype + "Provider"; for
    > example, an XML document provider would be
    > PsCx.PowerShell.Commands.XmlProvider
    >




      My System SpecsSystem Spec

PowerShell namespace design?

Similar Threads
Thread Forum
namespace exception
Greetings: I installed dotnet35, WindowsXP-KB926139-v2-x86-ENU.exe using administrator priveleges on an xp-pro os. I found this script that...
PowerShell
Re: "Design Patterns for Powershell"
As a developer (which you seem to be), I think this is a very good standards-oriented/developer-focused blog by a fellow PowerShell MVP:...
PowerShell
Using namespace directive?
Is there any equivalent of a 'using namespace' directive in Powershell? For example, it sometimes gets a bit verbose to explicitly qualify static...
PowerShell
WMI's IIS Namespace on a remote computer using Powershell
Has anyone tried to use Powershell to query the microsoftiisv2 namespace using powershell? Every time I try I get an 'Access denied'. If I try...
PowerShell
URI to namespace extension
Is it possible to reference files within a namespace extension using a URI? If so, what is the form of this URI? Thanks, Brad
PowerShell
Setting a WMI Namespace security descriptor with WMI/PowerShell
Hello, We're trying to set the SACL on the root/CIMV2 namespace. The whole namespace. This is the operation you usually perform in Computer...
PowerShell
tag not valid in namespace
Hi all. I'm new to WPF, and trying to run some simple XAML in my browser. Every time i get this: tag not valid in namespace...
Avalon