# Windows bootstarp issue

**URL:** <https://discourse.chef.io/t/windows-bootstarp-issue/9348>\
**Category:** Chef Infra (archive)\
**Created:** [September 8, 2016, 7:44am UTC](https://discourse.chef.io/t/windows-bootstarp-issue/9348 "2016-09-08T07:44:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sumanth](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@sumanth](https://discourse.chef.io/u/sumanth)\
**Post date:** [September 8, 2016, 7:44am UTC](https://discourse.chef.io/t/windows-bootstarp-issue/9348/1 "2016-09-08T07:44:04Z")

</div>

I am trying a test cookbook to create a file on windows node and hitting the following error

PS C:\CHEFworkstation\CBS\_CHEF\chef-starter\chef-repo\> knife bootstrap windows winrm 192.23.112.69 --winrm-user Administrator --winrm-password ‘XXXXXX’ --node-name node1 --run-list ‘recipe[wintest]’

Error: invalid option: --winrm-user  
USAGE: knife bootstrap [SSH\_USER@]FQDN (options)  
–bootstrap-curl-options OPTIONS  
Add options to curl when install chef-client  
–bootstrap-install-command COMMANDS  
Custom command to install chef-client  
–bootstrap-no-proxy [NO\_PROXY\_URL|NO\_PROXY\_IP]  
Do not proxy locations for the node being bootstrapped; this option is used internally by Opscode

I have already installed chef gem install knife-windows. but still getting the above error

---

<div class="post-metadata">

**Author:** ![Matt\_Wrock](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/matt_wrock/32/3394_2.png) [@Matt\_Wrock](https://discourse.chef.io/u/Matt_Wrock)\
**Post date:** [September 8, 2016, 1:29pm UTC](https://discourse.chef.io/t/windows-bootstarp-issue/9348/2 "2016-09-08T13:29:04Z")

</div>

If you have already run `chef gem install knife-windows`, it is likely that the `knife bootstrap` command is accessing a different ruby environment. This usuallyindicates a problem with your `PATH` which is most easily fixed by either using the provided chef-dk shell desktop shortcut or by running `chef shell-init powershell | Invoke-Expression`.

---

<div class="post-metadata">

**Author:** ![sumanth](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@sumanth](https://discourse.chef.io/u/sumanth)\
**Post date:** [September 29, 2016, 5:47am UTC](https://discourse.chef.io/t/windows-bootstarp-issue/9348/3 "2016-09-29T05:47:08Z")

</div>

Thank you … Ruby path was the issue  
chef shell-init powershell | Invoke-Expression worked.

---

<div class="post-metadata">

**Author:** ![Sandeep\_Singh](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@Sandeep\_Singh](https://discourse.chef.io/u/Sandeep_Singh)\
**Post date:** [November 12, 2020, 7:24am UTC](https://discourse.chef.io/t/windows-bootstarp-issue/9348/4 "2020-11-12T07:24:17Z")

</div>

Hello Matt\_wrock

Thanks, that resolved my issue as well. However, is there any permanent solution for this is so that we would not have to run this command( `chef shell-init powershell | Invoke-Expression` .) each time before running chef commands?
