Windows .NET Powershell - Overview

## Here I offer the reader a bit of output from the Microsoft Windows DotNet ( .NET ) Powershell. Powershell is available for windows uders to download for no cost, as a facility for interfacing with many .NET functions, as well as some typical Windows Shell (cmd.exe) functions; some interesting enhancements to the functionality of The OS and available .NET Framework components which may be able to do some heavy lifting, as its said, for the user in a fraction of the time and effort which may be required through other means.

## Plesae note that it is for the express purpose of DEMONSTRATION ONLY, so the reader might make his or her own decisions about the subject, as this author makes no claim here regarding the quality of the software itself or the operation thereof, his fascination with the software notwithstanding. NoviceNotes™ encourages you, the reader, to develop your own opinions and share your feelings in the comments below. We hot that such texts are educational, insightful, and balanced.

as output, verbatim from Windows PowerShell, the following shows a query instance of “get-help about_*”, where the last few cmdlet items are shown, then I specifiy precisely “get-help about_regular”, where Powershell was intuitive enough to display that which I wanted: more information on the available Windows .Net Powershell Regular Expression syntax

about_property             HelpFile                   Using object propertie...
about_provider             HelpFile                   Windows PowerShell pro...
about_pssnapins            HelpFile                   A Windows PowerShell s...
about_quoting_rules        HelpFile                   Rules for setting the ...
about_redirection          HelpFile                   Redirecting output fro...
about_ref                  HelpFile                   How to create and use ...
about_regular_expression   HelpFile                   Using regular expressi...
about_reserved_words       HelpFile                   Words in the Windows P...
about_scope                HelpFile                   The visibility a funct...
about_script_block         HelpFile                   Grouping statements an...
about_shell_variable       HelpFile                   Variables that are cre...
about_signing              HelpFile                   Describes the Windows ...
about_special_characters   HelpFile                   The special characters...
about_switch               HelpFile                   Using a switch to hand...
about_system_state         HelpFile                   Data maintained by the...
about_types                HelpFile                   Extending the .NET typ...
about_where                HelpFile                   Filter objects based o...
about_while                HelpFile                   A language statement f...
about_wildcard             HelpFile                   Using wildcards in Cmd...

SEE ALSO
    For information about the match comparison operator, enter the
    following command at the PowerShell command prompt:

        help about_comparison_operators

    See the MSDN Documentation on Regular Expression Language Elements

PS C:\> get-help about_regular
TOPIC
    Regular expressions


SHORT DESCRIPTION
    Using regular expressions in Cmdlet parameters in the Windows PowerShell


LONG DESCRIPTION

    PowerShell supports a number of the regular expression characters:

        Format   Logic                           Example
        ——– ——————————- ———————–
        value    Matches exact characters        “book” -match “oo”
                 anywhere in the original value
        .        Matches any single character    “copy” -match “c..y”
        [value]  Matches at least one of the     “big” -match “b[iou]g”
                 characters in the brackets
        [range]  Matches at least one of the     “and” -match “[a-e]nd”
                 characters within the range.
                 The Use of a hyphen (-) allows
                 specification of contiguous
                 character.
        [^]      Matches any character except    “and” -match “[^brt]nd”
                 those in brackets
        ^        Matches the beginning           “book” -match “^bo”
                 characters
        $        Matches the end characters      “book” -match “ok$”
        *        Matches zero or more instances  “baggy” -match “g*”
                 of the preceding character
        ?        Matches zero or one instance    “baggy” -match “g?”
                 of the preceding character
        \        Matches the character that      “Try$” -match “Try\$”
                 follows as an escaped character

    PowerShell supports the character classes available in .NET regular
    expressions
        Format   Logic                           Example
        ——– ——————————- ———————–
        \p{name} Matches any character in the    “abcd defg” -match “\p{Ll}+”
                 named character class specified
                 by {name}. Supported names are
                 Unicode groups and block
                 ranges. For example, Ll, Nd,
                 Z, IsGreek, IsBoxDrawing.
        \P{name} Matches text not included in    1234 -match “\P{Ll}+”
                 groups and block ranges
                 specified in {name}.
        \w       Matches any word character.     “abcd defg” -match “\w+”
                 Equivalent to the Unicode       (this matches abcd)
                 character categories [\p{Ll}
                 \p{Lu}\p{Lt}\p{Lo}\p{Nd}\p{Pc}].
                 If ECMAScript-compliant behavior
                 is specified with the ECMAScript
                 option, \w is equivalent to
                 [a-zA-Z_0-9].
        \W       Matches any nonword character.  “abcd defg” -match “\W+”
                 Equivalent to the Unicode       (This matches the space)
                 categories [^\p{Ll}\p{Lu}\p{Lt}
                 \p{Lo}\p{Nd}\p{Pc}].
        \s       Matches any white-space         “abcd defg” -match “\s+”
                 character.  Equivalent to the
                 Unicode character categories
                 [\f\n\r\t\v\x85\p{Z}].
        \S       Matches any non-white-space     “abcd defg” -match “\S+”
                 character. Equivalent to the
                 Unicode character categories
                 [^\f\n\r\t\v\x85\p{Z}].
        \d       Matches any decimal digit.      12345 -match “\d+”
                 Equivalent to \p{Nd} for
                 Unicode and [0-9] for non-
                 Unicode behavior.
        \D       Matches any nondigit.           “abcd” -match “\D+”
                 Equivalent  to \P{Nd} for
                 Unicode and [^0-9] for non-
                 Unicode behavior.

    PowerShell supports the quantifiers available in .NET regular expressions,
    the following are some examples of quantifiers

        Format   Logic                           Example
        ——– ——————————- ———————–
        *        Specifies zero or more matches; “abc” -match “\w*”
                 for example, \w* or (abc)*.
                 Equivalent to {0,}.
        +        Matches repeating instances of  “xyxyxy” -match “xy+”
                 the preceding characters
        ?        Specifies zero or one matches;  “abc” -match “\w?”
                 for example, \w? or (abc)?.
                 Equivalent to {0,1}.
        {n}      Specifies exactly n matches;    “abc” -match “\w{2}”
                 for example, (pizza){2}.
        {n,}     Specifies at least n matches;   “abc” -match “\w{2,}”
                 for example, (abc){2,}.
        {n,m}    Specifies at least n, but no    “abc” -match “\w{2,3}”
                 more than m, matches.

    All of the comparisons shown in the above examples in the table
    above evaluate to true.

    Note that the escape character for regular expressions is different
    than that of the PowerShell.  The character escape for regular
    expressions is the backslash “\”.

SEE ALSO
    For information about the match comparison operator, enter the
    following command at the PowerShell command prompt:

        help about_comparison_operators

    See the MSDN Documentation on Regular Expression Language Elements

PS C:\>

NoviceNotes™ Partner Page on Google!

Check this out:
http://apps.novicenotes.com

jEdit - Word Wrap Icon

Intended Audience:

O/S: Microsoft Windows, Linux [most] distributions, Mac, and others
Experience: Beginner - Advanced; Everyone
Note: In this context, a “beginner” is any User who is new to Web Design / Web Development, and software commonly used in the practice thereof.

Incl.:
6 img: sizes
1 txt: readme

Word wrap Icon - various sizes
Toolbar Icon: Word wrap

Download Options:

Emancipated by Design :
Software Developed for You

JEdit is a Platform Independent desktop application– that is, jEdit is in a growing class of software which is developed to run on any user’s computer– regardless of the O/S, or Operating System. jEdit is available for no cost at Sourceforge.net . I created this icon because I now use the Tango icon theme in jEdit– a remarkable improvement on the appearance of the editor, in my opinion. (Tango has been available as a native Look and Feel option since jEdit 4.3.14)

:-)

W3C Specification

A Closer Look at W3C Technical Reports and Publications:

Part One view [+]

Standard Frustration

Web Design & Web Application Development + …

In the context of Web Design and Web Development standards, there is one prevailing source of confusion; one primary element responsible for blowing the minds of beginners, and without prejudice for seasoned professionals, that their disagreement upon its proper interpretation should perpetuate the elusive quality of its very definition. Depending upon the media context (e.g. html, xml, rss, microformats, etc.), it may be as tangible to grasp in the palm an idea yet to fully manifest amongst a group of intellectuals engaged in brainstorming– this element (which, I admit, I’m terribly beating ’round the bush to cite) has already been guessed by some readers, and by anyone less patient with my ruse, I must do right now to disclose that it is a document (or body of documents, and drafts) authored by the globally recognized authority on web media; the entity known as the World Wide Web Consortium (aka. the W3C).

The W3C publication is that element which– often referenced, perhaps less-often truly studied– has been (and likely, will continue to be) the source of misunderstanding, error, difficulty, frustration, and other problems: from a simple disagreement between two users in discussion over the CSS display property, inline-block, to errors in judgement by a professional web author resulting in a grossly distorted rendering of his or her design. Misinterpretation of the guidelines set forth by a published Recommendation (that is, an “official Recommendation”; the publically available document, or draft, designed to establish industry-wide conformance; a set of guidelines, recognized by industry leaders as the Standard by which new products must comply; a working draft, though never to be cited as a Standard Recommendation, may be regarded in general as the most eligible candidate for a standard, forthcoming), or likewise, a proper interpretation continuing to another extreme which may surface as a bug in the latest release of your favourite web browser software– should that software render a miscalculation of the Standard, or as suggested at the start of this article– the prevailing element of confusion of the WWW.

Elemental Dynamic Noise

The W3C Recommendation is that element. It is generally referenced by the community at large when the phrase Web Standards is tossed about, but it is more accurate to differentiate: only the various media listed under the W3C Technical Reports and Publications should be termed a “Web Standard” ; only those communication media, some of which are far from practical use by the general public, and yet unknown to you or I, but for which there exists a W3C Standard Recommendation should be referenced as a Web Standard.

It is that standard element– the W3C Technical Recommendation which, has either caused frustration for the html author wishing to “author valid html markup in compliance with web standards”, as he or she has followed the W3C Recommendation from the start of a project– or, for as many existing documents which became a part of so many revised web sites, the source-code would be painstakingly rewritten so that any formerly invalid markup would eventually comply (i.e. would pass the W3C SGML parser for markup validation).

The rhetoric used here does take for granted that the reader is aware of the following: though there are many W3C publications, to properly follow the Standard, only one Standard should be followed by a web author for any given project, or instance of a web document, hence the use of the singular, element here, which I’ve attempted to analogize with the concept of a singular standard.

This is the Standard of Excellence

Let the reader make no mistake about the validity of the W3C, its contributions, and the Technical Recommendations; that, whether Web Standards have been the source of confusion or not– it is nevertheless proper to follow those standards, if the technology is to grow and maintain its current role as prosperous element of civilization.

For those who have been familiar with the W3C Recommendations, I suspect that they might agree: it is not enough simply to be known as a W3C publication for such a document to achieve global acceptance, but only those documents which have been passed through various levels of revision, ultimately to become the Standard, which will carry the highly regarded, unique label of Recommendation (e.g. the HTML 4.01 Specification became a Recommendation in 1999)

Part Two view [+]

So Many Specs. So Little Time.

The web development community tends to pass around questions like “…are they ever going to approve ____ ?…”, while others rejoice when a software vendor announces support for one of the pending Specification while its still in draft, or the candidate recommendation state, such as the recent milestone upgrade released by Mozilla, in Firefox 3, and not surprisingly, a little earlier by Opera Software ASA, when we saw Opera 9.2 debut html page rendering support for CSS3. Though it is not yet an official Standard Recommendation (in fact, even CSS 2.1 has yet to achieve that level of support), it’s exciting to witness the potential being breathed into our primary web medium, HTML and CSS, by software engineering genius of companies like Opera and Mozilla: when the text-shadow property sprang to life in Opera 9.2, or the rgba(red, green, blue, alpha); colorspace support so elegantly rendered by Gecko 1.9 in Firefox 3. One might say it seems we have far to go before CSS3 is a reality, in W3C Specification terms, and yet these properties are already showing up in stylesheets across the web, not just being used by font fanatics and typography enthusiasts, but those of us who are more driven by the purpose of staying up-to-date in daily practice, not to mention those who just enjoy playing with the newest toys.

How long till we see a browser which will claim to support HTML 5, giving web developers the opportunity to code for that forthcoming standard? In this marginal epoch, such little time having passed from the release of a Working Draft, for you or I to make predictions concerning the status of the HTML 5 Standard would hardly be quite reasonable. Instead of trying to see beyond our scope, perhaps a more sensible direction to focus energy in the meantime will require a turnabout, toward a retrospective insight: the reader is advised to review the index of W3C Technical Reports and Publications, Configurable Views (note the various criteria made optional for sorting the TR Index).

Think for Yourself. Question Authority.

What is there to gain by looking at a rather unexciting list of Specification documents? Furthermore, what is the motivation for the W3C to offer various ways of sorting the several documents, otherwise known as the TR, or Technical Recommendations– the ubiquitous W3C Standards– the same standard benchmark referenced in HTML Validation software, the pass/ fail test fussed over by so many Web Standards conscious developers, as they test their own work for valid XML / SGML markup (i.e. semantically well-formed code for the world wide web)? (Note: these are, of course, the very specs by which the term Web Standards is able to exist)

Consider the status of a document as it passes through various, structured versions; official updates, as authored, reviewed, and edited by contributing members of the World Wide Web Consortium, where Recommendations are the Standard, and a Working Draft is the first recognized version of a forthcoming Standard:

  • Recommendations
  • Proposed Recommendations
  • Proposed Edited Recommendations
  • Candidate Recommendations
  • Working Drafts

In observation of these various levels, because of its wide use, and that I author this text consider the status of the CSS 2.0 Recommendation, and that of CSS 2.1 which appended some minor changes which basically enhance the existing specification.

If the reader would like to have a better understanding of W3C Specification time-lines, I urge you to review the W3C Technical Reports, and find the answers to the following questions. Good luck!

  • When did the CSS 2.0 spec become an official W3C Recommendation?
  • When was CSS 2.1 passed on from its status as a Working Draft to become a Candidate Recommendation?
  • What is the current status of the CSS 2.1 Specification?


W3C Technical Reports and Publications, the Index. Available at http://www.w3.org/TR/ . Last Accessed: 2008-08-17

HTML 5: the Fate of Style, Decided?

If you are in the habit of authoring valid, forward compatible hypertext markup, then you have probably heard rumors that the HTML element attribute style=“ ”, may be deprecated in HTML 5. The style=“ ” attribute is a valid attribute of HTML 4.01 and XHTML 1.0, and according to the HTML 5 draft in progress, style="" will maintain its place as a valid HTML 5 element attribute as well. However, the reader must take into consideration that HTML 5 is a long way from being the Recommendation by which web browser vendors will design; are designing new prototypes which will some day implement the new standard.

More information about changes to come in HTML 5 is available at the current non-normative, W3C HTML 5 Working Draft

Non-Normative Resources & the Value of Credibility

When reading a W3C draft, one might notice in the document text, styled in bold type, enclosed in attention-grabbing borders, and in multiple instances near the page head, the sidebar or the footer of each page, that the Authors want everyone to know immediately that the document is a working draft. The W3C uses the term non-normative in reference to their draft documents.
The web development community knows these documents well, but perhaps more commonly referenced, or cited outside of the document itself, is a W3C Recommendation; a working draft which has been submitted for review, has been accepted to be passed on as a Candidate for Recommendation, and finally passed on to become the normative document, as a Standard Recommendation.

The URL above is the HTML 5 Working Draft. While it is written by members of the authoritative entity commonly known as the W3C, and reviewed by other significant contributing bodies, outside sources (such as NoviceNotes) should not reproduce the content because by nature, as a non-normative reference, it is subject to change.

Why might the W3C wish to label their Recommendations, so conspicuously, as non-normative documents? I present the following list, so the reader might consider these issues when he or she makes a decision to copy, or reference material from a W3C working draft.

  • In comparison to those that they label as a non-normative Working Draft, the W3C grants license to reproduce parts of the normative Standards, such as CSS 2.0 (vs CSS 2.1)
  • The content is subject to change, at any time rendering reproduced text invalid
  • Any reproduction of draft material is potentially a misrepresentation of the original author, and the revised text
  • Within the context of scholarly, technical data, what opinion might the reader develop concerning the credibility of a resource which would reproduce draft material?

The Word Wide Web Consortium - Available at http://www.w3.org

BACK TO TOP | All Content © 2006 - 2009, NoviceNotes™ | © 2009 NoviceNotes.Net