{"action":"created","issue":{"url":"https://api.github.com/repos/chef/chef-docs/issues/565","labels_url":"https://api.github.com/repos/chef/chef-docs/issues/565/labels{/name}","comments_url":"https://api.github.com/repos/chef/chef-docs/issues/565/comments","events_url":"https://api.github.com/repos/chef/chef-docs/issues/565/events","html_url":"https://github.com/chef/chef-docs/issues/565","id":92511097,"number":565,"title":"`chef shell-init` doc improvements for windows","user":{"login":"danielsdeleo","id":37162,"avatar_url":"https://avatars.githubusercontent.com/u/37162?v=3","gravatar_id":"","url":"https://api.github.com/users/danielsdeleo","html_url":"https://github.com/danielsdeleo","followers_url":"https://api.github.com/users/danielsdeleo/followers","following_url":"https://api.github.com/users/danielsdeleo/following{/other_user}","gists_url":"https://api.github.com/users/danielsdeleo/gists{/gist_id}","starred_url":"https://api.github.com/users/danielsdeleo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielsdeleo/subscriptions","organizations_url":"https://api.github.com/users/danielsdeleo/orgs","repos_url":"https://api.github.com/users/danielsdeleo/repos","events_url":"https://api.github.com/users/danielsdeleo/events{/privacy}","received_events_url":"https://api.github.com/users/danielsdeleo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-07-01T23:55:58Z","updated_at":"2015-07-02T15:09:44Z","closed_at":null,"body":"*NOTE:* I imported this from https://github.com/chef/chef-dk/issues/448 there's a few bits that aren't relevant to chef-docs.\r\n\r\n----\r\n\r\nIn the spirit of improving the Windows documentation... if you following the instructions for 'chef shell-init' literally on a clean Windows 8.1 machine with the latest ChefDK installed, the commands cannot be appended to $PROFILE because the folder does not exist if you have a new user profile.  The error given in that case is as follows:\r\n\r\n```\r\nPS C:\\Users\\Stuart> \"chef shell-init powershell | Invoke-Expression\" >> $PROFILE\r\nout-file : Could not find a part of the path\r\n'C:\\Users\\Stuart\\Documents\\WindowsPowerShell\\Microsoft.PowerShell_profile.ps1'.\r\nAt line:1 char:1\r\n+ \"chef shell-init powershell | Invoke-Expression\" >> $PROFILE\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n    + CategoryInfo          : OpenError: (:) [Out-File], DirectoryNotFoundException\r\n    + FullyQualifiedErrorId : FileOpenFailure,Microsoft.PowerShell.Commands.OutFileCommand\r\n```\r\nOne way around this is to use the following PowerShell instead of that suggested by 'chef shell-init'\r\n\r\n```powershell\r\nif(Test-Path $PROFILE){ chef shell-init powershell | Add-Content $PROFILE } else { New-Item -Force -ItemType File $PROFILE; chef shell-init powershell | Add-Content $PROFILE }\r\n```\r\n\r\nThis could be changed at https://github.com/chef/chef-dk/blob/master/lib/chef-dk/command/shell_init.rb#L49 \r\n\r\nAdditionally, if this is a new machine then it is also worth mentioning the execution of PowerShell scripts will not work until an administrator executes the following:\r\n\r\n```powershell\r\nSet-ExecutionPolicy RemoteSigned\r\n```\r\n\r\nNeither of the above two points are mentioned at https://docs.chef.io/install_dk.html#powershell - additionally reference is made to a command 'posh' and I'm not sure where that comes from, certainly you can't run this on a Windows 8.1 or higher machine in out-of-box configuration.\r\n\r\n![install_the_chef_dk_ _chef_docs](https://cloud.githubusercontent.com/assets/6384654/8466189/5a4f22a0-2050-11e5-8865-42472c0eec72.png)\r\n\r\nThis is in addition to https://github.com/chef/chef-dk/issues/429 that @smurawski raised a little while ago too."},"comment":{"url":"https://api.github.com/repos/chef/chef-docs/issues/comments/118063380","html_url":"https://github.com/chef/chef-docs/issues/565#issuecomment-118063380","issue_url":"https://api.github.com/repos/chef/chef-docs/issues/565","id":118063380,"user":{"login":"danielsdeleo","id":37162,"avatar_url":"https://avatars.githubusercontent.com/u/37162?v=3","gravatar_id":"","url":"https://api.github.com/users/danielsdeleo","html_url":"https://github.com/danielsdeleo","followers_url":"https://api.github.com/users/danielsdeleo/followers","following_url":"https://api.github.com/users/danielsdeleo/following{/other_user}","gists_url":"https://api.github.com/users/danielsdeleo/gists{/gist_id}","starred_url":"https://api.github.com/users/danielsdeleo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielsdeleo/subscriptions","organizations_url":"https://api.github.com/users/danielsdeleo/orgs","repos_url":"https://api.github.com/users/danielsdeleo/repos","events_url":"https://api.github.com/users/danielsdeleo/events{/privacy}","received_events_url":"https://api.github.com/users/danielsdeleo/received_events","type":"User","site_admin":false},"created_at":"2015-07-02T15:09:44Z","updated_at":"2015-07-02T15:09:44Z","body":"Thanks!"}}