Skip to content

What is the purpose of the -Command parameter? #12610

@freonpsandoz

Description

@freonpsandoz

Type of issue

Missing information

Feedback

For execution of commands in a string, powershell and powershell -Command appear to do the same thing. Is the same true for execution of a script block? Please clarify exactly when the -Command parameter is needed.

Page URL

https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_powershell_exe?view=powershell-5.1

Content source URL

https://github.com/MicrosoftDocs/PowerShell-Docs/blob/main/reference/5.1/Microsoft.PowerShell.Core/About/about_PowerShell_exe.md

Author

@sdwheeler

Platform Id

2d3e0f2a-b45f-5295-f30f-a3a8408d92af

Document Id

2a47dda6-5d42-249c-5d48-19ad6fbc7b3c

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions