Chef command not found after install

Hi all. I just upgraded to the latest&greated chef workstation, directly from the chef.io/downloads page. After installation, when i run chef -v i get the ol' cmdlet not found:

PS C:\Users\MaxCadmin> chef -v
chef : The term 'chef' is not recognized as the name of a cmdlet, function, script file, or operable program.

I was doing this install to try to fix the same issue on 20.8. It was all working well recently.

C:\opscode\chef-workstation\bin\ is in the $PATH .However, chef-client -v does work: Chef Infra Client: 16.4.41

knife also works: also give the Chef Infra Client version.

For more context on why client and workstation would both be on here, this is a Jenkins agent that i have configured (partially) with chef, and that also has to run chef in jenkins pipelines.

Any ideas on how to resolve/where to look? It's a Win 2012 R2 machine. I feel like it's a path issue but i can't find/fix it.

  • Path:
C:\Program Files\Common Files\Microsoft Shared\Microsoft Online Services
C:\Program Files (x86)\Common Files\Microsoft Shared\Microsoft Online Services
C:\Ruby25-x64\bin
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin
C:\Program Files (x86)\Common Files\Oracle\Java\javapath
C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin
C:\Program Files (x86)\MSBuild\14.0\Bin
C:/_utilities/Nuget
C:/_utilities/ChromeDriver
C:\Program Files (x86)\7-Zip
C:\ProgramData\Oracle\Java\javapath
C:\Windows\system32
C:\Windows
C:\Windows\System32\Wbem
C:\Windows\System32\WindowsPowerShell\v1.0\
C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\
C:\Program Files\Microsoft SQL Server\110\Tools\Binn\
C:\Program Files\Microsoft SQL Server\110\DTS\Binn\
C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\
C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\
C:\Program Files\Microsoft SQL Server\120\Tools\Binn\
C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin
C:/_utilities/Nuget
C:/_utilities/ChromeDriver
C:\Program Files (x86)\7-Zip
C:\ProgramData\Oracle\Java\javapath
C:\Windows\system32
C:\Windows
C:\Windows\System32\Wbem
C:\Windows\System32\WindowsPowerShell\v1.0\
C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\
C:\Program Files\Microsoft SQL Server\110\Tools\Binn\
C:\Program Files\Microsoft SQL Server\110\DTS\Binn\
C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\
C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\
C:\Program Files\Microsoft SQL Server\120\Tools\Binn\
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE
C:\Windows\Microsoft.NET\Framework64\v4.0.30319
C:\Program Files\Git\cmd
C:\Program Files\Microsoft\Web Platform Installer\
C:\Program Files\Windows Fabric\bin\Fabric\Fabric.Code.1.0
C:\Program Files (x86)\Microso
C:\Program Files\OpenJDK\openjdk-11.0.7_10-jre\bin
C:\Program Files\dotnet\
C:\ProgramData\chocolatey\bin
C:\Program Files\PowerShell\7\
C:\opscode\chef-workstation\bin\
C:\opscode\chef-workstation\bin
C:\opscode\chef-workstation\embedded\bin
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow
C:\Users\hl_tfsbuild\AppData\Local\GitHubDesktop\bin
C:\Users\hl_tfsbuild\AppData\Local\Programs\Microsoft VS Code\bin
C:\Users\hl_tfsbuild\.dotnet\tools
C:\Program Files\nodejs\

Have you tried launching from the shortcut that the workstation app adds to the desktop? I have had issues with running from powershell on locked down machines, but the shortcut that the workstation installer places on the desktop always seems to work.

I wish this was a less-stupid answer, but it turned out that the BitDefender security software had deleted the chef.exe app out of the C:/opscode/chef-workstation/bin directory. It kept doing this even after restoring the file out of its "quarantine".

So i'm kind of stalled on that box until InfoSec can whitelist the app.

What's weird is we have BitDefender on all of our endpoints, and this is the only box that this has happened on. Unfortunately it's a Jenkins windows agent, so it's kind of important. And, it was working until very recently.