Powershell Best Practice #14: Specify the extension for applications

By | July 5, 2015

Best Practice: It is recommended to append the .exe extension to applications.

Explanation: By adding the extension .exe for applications, you make your code easier to read and you also prevent any confusion.

For example, running sc.exe and sc in PowerShell is different.

sc.exe (it runs C:\Windows\System32\sc.exe)

powershell-sc-exe

sc (is an alias for Set-Content)

set-content-powershell


previous-buttonnext-button

Leave a Reply

Your email address will not be published.