Share via

powershell programming

Shirley Reischman 0 Reputation points
2026-03-12T21:19:45.7333333+00:00

What language is used in the PowerShell? What are the commands used in PowerShell?

Windows for home | Windows 10 | Settings
0 comments No comments

1 answer

Sort by: Most helpful
  1. Q&A Assist
    2026-03-12T21:20:00.9066667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    PowerShell uses its own scripting language, commonly called the PowerShell language. It is built on top of the .NET Framework (or .NET) and works with .NET objects rather than plain text.

    The PowerShell language includes:

    • Shell language keywords such as for, foreach, try, catch, and trap.
    • A rich scripting syntax with looping, conditions, flow control, and variable assignment, similar in style to C#.

    Commands used in PowerShell fall into several categories:

    1. Cmdlets
    • Native PowerShell commands, not stand-alone executables.
    • Named using a Verb-Noun pattern, for example:
      • Get-Command – lists commands available in the shell
      • Set-Location – changes the current directory
      • Get-ChildItem – lists items in a directory
    • Cmdlets are grouped into modules and can be written in any compiled .NET language or in PowerShell itself.
    1. Shell language keywords
    • Built into the language and used for control flow and script structure, for example:
      • if, else, for, foreach, try, catch, trap
    1. OS-native commands
    • Executable files and scripts provided by the operating system, such as sort.exe or .cmd batch files.
    • PowerShell can run these just like other shells.
    1. PowerShell-specific commands in scripts, functions, and modules
    • Scripts (.ps1 files)
    • Functions defined in PowerShell
    • Methods exposed by .NET objects

    PowerShell also provides operators and helper commands to run other commands, for example:

    • Call operator & to execute a command stored in a variable or string.
    • Start-Process to start native processes with options like different credentials or redirected input/output.
    • Invoke-Item to perform the default action for a file or URL (for example, open a URL in the default browser).

    References:

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.