Open SteveDelFante opened 8 years ago
the chefdk link launches this ps1, which loads the module:
gc C:\opscode\chefdk\bin\start-chefdk.ps1
Try {
$conemulocation = "$env:programfiles\ConEmu\Conemu64.exe"
# We don't want the current path to affect which "chef shell-init powershell" we run, so we need to set th
e PATH to include the current omnibus.
$chefdk_bin = (split-path $MyInvocation.MyCommand.Definition -Parent)
$chefdkinit = '"$env:PATH = ''' + $chefdk_bin + ';'' + $env:PATH; $env:CHEFDK_ENV_FIX = 1; chef shell-init
powershell | out-string | iex; Import-Module chef -DisableNameChecking"'
$chefdkgreeting = "echo 'PowerShell $($PSVersionTable.psversion.tostring()) ($([System.Environment]::OSVer
sion.VersionString))';write-host -foregroundcolor darkyellow 'Ohai, welcome to ChefDK!`n'"
$chefdkcommand = "$chefdkinit;$chefdkgreeting"
$chefdktitle = "Administrator: ChefDK ($env:username)"
if ( test-path $conemulocation )
{
start-process $conemulocation -verb runas -argumentlist '/title',"`"$chefdktitle`"",'/cmd','powershell
.exe','-noexit','-command',$chefdkcommand
}
else
{
start-process powershell.exe -verb runas -argumentlist '-noexit','-command',"$chefdkcommand; (get-host
).ui.rawui.windowtitle = '$chefdktitle'"
}
}
Catch
{
sleep 10
Throw
}
so we should probably figure out how to put this same logic in the powershell profile on the workstation so it happens every time.
Hwne I run this from cmder, I get the
recipe[recipes]
bugBut, it works on the ChefDK shortcut on the desktop. :