Warum werden Windows PowerShell-Befehle als Cmdlets bezeichnet?

Inhaltsverzeichnis:

Video: Warum werden Windows PowerShell-Befehle als Cmdlets bezeichnet?

Video: Warum werden Windows PowerShell-Befehle als Cmdlets bezeichnet?
Video: Diese macOS Einstellungen solltest du SOFORT ändern (macOS Monterey)! | Nils-Hendrik Welk 2024, März
Warum werden Windows PowerShell-Befehle als Cmdlets bezeichnet?
Warum werden Windows PowerShell-Befehle als Cmdlets bezeichnet?
Anonim

Bei der Arbeit mit Windows PowerShell sind Sie möglicherweise auf den Begriff Cmdlet gestoßen und etwas verwirrt. Ist ein Cmdlet etwas völlig anderes als ein Befehl oder ist es nur der Name der PowerShell für sie? Der heutige Q & A-Beitrag von SuperUser enthält die Antwort auf eine Frage des neugierigen Lesers.

Die heutige Question & Answer-Sitzung wird von SuperUser zur Verfügung gestellt - einer Unterteilung von Stack Exchange, einer Community-basierten Gruppierung von Q & A-Websites.

Die Frage

SuperUser Reader RBT möchte wissen, warum Windows PowerShell-Befehle als Cmdlets bezeichnet werden:

I have been trying to figure out the nomenclature for why commands are called command-lets (cmdlets) in PowerShell. Why they are not simply called commands instead? What is the difference?

I could only guess based on this Wikipedia article about PowerShell that it might somehow be an abbreviation of the command line interface to interact with commands written in.Net.

Warum werden Windows PowerShell-Befehle als Cmdlets bezeichnet?

Die Antwort

SuperUser-Mitwirkender LotPings hat die Antwort für uns:

According to Microsoft:

A cmdlet is a lightweight command that is used in the Windows PowerShell environment. The Windows PowerShell runtime invokes these cmdlets within the context of automation scripts that are provided at the command line. The Windows PowerShell runtime also invokes them programmatically through Windows PowerShell APIs.

How Cmdlets Differ from Commands

Cmdlets differ from commands in other command-shell environments in the following ways:

  • Cmdlets are instances of.NET Framework classes; they are not stand-alone executables.
  • Cmdlets can be created from as few as a dozen lines of code.
  • Cmdlets do not generally do their own parsing, error presentation, or output formatting. Parsing, error presentation, and output formatting are handled by the Windows PowerShell runtime.
  • Cmdlets process input objects from the pipeline rather than from streams of text, and cmdlets typically deliver objects as output to the pipeline.
  • Cmdlets are record-oriented because they process a single object at a time.

Source: Cmdlet Overview [Microsoft]

Haben Sie etwas zur Erklärung hinzuzufügen? Ton aus in den Kommentaren. Möchten Sie mehr Antworten von anderen technisch versierten Stack Exchange-Benutzern lesen? Hier geht es zum vollständigen Diskussionsthread.

Empfohlen: