Skip to content
This repository has been archived by the owner on Jul 14, 2021. It is now read-only.

Update start-chefdk.ps1 #1478

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions omnibus/resources/chefdk/msi/assets/start-chefdk.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ Try {

if ( test-path $conemulocation )
{
start-process $conemulocation -verb runas -argumentlist '/title',"`"$chefdktitle`"",'/cmd','powershell.exe','-noexit','-command',$chefdkcommand
start-process $conemulocation -verb runas -argumentlist '-ExecutionPolicy Bypass','/title',"`"$chefdktitle`"",'/cmd','powershell.exe','-noexit','-command',$chefdkcommand

Choose a reason for hiding this comment

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

These arguments are in the wrong order. Removing the "-verb runas", we should be left with:

        start-process $conemulocation -argumentlist '/title',"`"$chefdktitle`"",'/cmd','powershell.exe','-ExecutionPolicy Bypass','-noexit','-command',$chefdkcommand

}
else
{
start-process powershell.exe -verb runas -argumentlist '-noexit','-command',"$chefdkcommand; (get-host).ui.rawui.windowtitle = '$chefdktitle'"
start-process powershell.exe -verb runas -argumentlist '-ExecutionPolicy Bypass','-noexit','-command',"$chefdkcommand; (get-host).ui.rawui.windowtitle = '$chefdktitle'"

Choose a reason for hiding this comment

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

Should be something like:

        start-process powershell.exe -argumentlist '-ExecutionPolicy Bypass','-noexit','-command',"$chefdkcommand; (get-host).ui.rawui.windowtitle = '$chefdktitle'"

}
}
Catch
Expand Down