Skip to content

Commit

Permalink
run cmd.exe by its path again instead of COMSPEC variable
Browse files Browse the repository at this point in the history
thanks to the explanation by @DHowett in the microsoft/terminal repo,
I now believe this is the better way:

microsoft/terminal#6684 (comment)
  • Loading branch information
jantari committed Jul 29, 2020
1 parent 5d08e57 commit 6385210
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion private/Invoke-PackageCommand.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
$process.StartInfo.WindowStyle = [System.Diagnostics.ProcessWindowStyle]::Hidden
$process.StartInfo.UseShellExecute = $true
$process.StartInfo.WorkingDirectory = $Path
$process.StartInfo.FileName = $env:ComSpec
$process.StartInfo.FileName = "${env:SystemRoot}\system32\cmd.exe"
# We can't have a space after the arguments (before the redirection operator) because it'd
# be passed through to the executable arguments and that causes GitHub#15
# We do need a space between the quoted executable path and the arguments though or else
Expand Down

3 comments on commit 6385210

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PSScriptAnalyzer results as of this commit:

  • 3 Warning
See details
Location : ./private/New-WebClient.ps1 [1, 10]
RuleName : PSUseShouldProcessForStateChangingFunctions
Severity : Warning
Message  : Function 'New-WebClient' has verb that could change system state. Therefore, 
           the function has to support 'ShouldProcess'.

Location : ./private/Test-MachineSatisfiesDependency.ps1 [5, 17]
RuleName : PSReviewUnusedParameter
Severity : Warning
Message  : The parameter 'DebugLogFile' has been declared but not used. 

Location : ./private/Set-BIOSUpdateRegistryFlag.ps1 [1, 10]
RuleName : PSUseShouldProcessForStateChangingFunctions
Severity : Warning
Message  : Function 'Set-BIOSUpdateRegistryFlag' has verb that could change system state
           . Therefore, the function has to support 'ShouldProcess'.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PSScriptAnalyzer results as of this commit:

  • 3 Warning
See details
Location : ./private/Test-MachineSatisfiesDependency.ps1 [5, 17]
RuleName : PSReviewUnusedParameter
Severity : Warning
Message  : The parameter 'DebugLogFile' has been declared but not used. 

Location : ./private/Set-BIOSUpdateRegistryFlag.ps1 [1, 10]
RuleName : PSUseShouldProcessForStateChangingFunctions
Severity : Warning
Message  : Function 'Set-BIOSUpdateRegistryFlag' has verb that could change system state
           . Therefore, the function has to support 'ShouldProcess'.

Location : ./private/New-WebClient.ps1 [1, 10]
RuleName : PSUseShouldProcessForStateChangingFunctions
Severity : Warning
Message  : Function 'New-WebClient' has verb that could change system state. Therefore, 
           the function has to support 'ShouldProcess'.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PSScriptAnalyzer results as of this commit:

  • 3 Warning
See details
Location : ./private/Test-MachineSatisfiesDependency.ps1 [5, 17]
RuleName : PSReviewUnusedParameter
Severity : Warning
Message  : The parameter 'DebugLogFile' has been declared but not used. 

Location : ./private/Set-BIOSUpdateRegistryFlag.ps1 [1, 10]
RuleName : PSUseShouldProcessForStateChangingFunctions
Severity : Warning
Message  : Function 'Set-BIOSUpdateRegistryFlag' has verb that could change system state
           . Therefore, the function has to support 'ShouldProcess'.

Location : ./private/New-WebClient.ps1 [1, 10]
RuleName : PSUseShouldProcessForStateChangingFunctions
Severity : Warning
Message  : Function 'New-WebClient' has verb that could change system state. Therefore, 
           the function has to support 'ShouldProcess'.

Please sign in to comment.