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
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