Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am implementing a new instance of (Open-source v10.12) Chef in an existing environment. Currently the environment is mostly Windows, but more Linux is being introduced. I have used Chef in a previous gig, however that was a *nix-only environment.

Because this is a primarily-Windows environment, my main workstation is Windows 7 (x64), and I use Powershell as my main terminal.

I created a ~\.chef directory, populated with a knife.rb and my client.pem file. When I run knife client list from ~, I get the expected results.

I keep my work in Dropbox just in case my laptop should fail or be stolen. When I run knife client list from the repo directory (C:\Users\waldo\Dropbox_company\projects\chef`), I get

ERROR: Your private key could not be loaded from C:/home/waldo/.chef/waldog.pem Check your configuration file and ensure that your private key is readable

(Note that the path is incorrect)

This is the progression as I walk up the tree towards my ~ running knife client list:

C:\Users\waldo\Dropbox\_company\projects\ => Above error
C:\Users\waldo\Dropbox\_company\          => Above error
C:\Users\waldo\Dropbox\                   => It works!  (Expected results)
C:\Users\waldo\                           => Expected results
C:\Users\waldo\Documents\                 => Expected Results
C:\Users\waldo\Documents\GitHub           => Expected Results
C:\Users\waldo\Documents\GitHub\aProject\ => Expected Results


(All files are on local disk; none of these locations are mapped/mounted from a remote server.)

Now, I know that I can add -c path\to\knife.rb, but that's a HUGE PITA.

Question is: Why is knife inconsistently reading my ~\.chef\knife.rb, and how can I get around that without incurring carpal tunnel?

share|improve this question

1 Answer 1

While not quite what you're looking for, how about you trying doskey:

C:> doskey alias_name=C:>\path\to\knife -c \path\to\knife.rb $*

I'm sure knife isn't going to be the only thing you'd like shortcuts to type, so doskey's great for making terminal work easier. We commonly use aliases in our (mac) shop to do things like kcu (knife cookbook upload) or git co (git checkout) etc etc.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.