<powershell>
$download_url = "https://s3-eu-west-1.amazonaws.com/aws-opsworks-cm-eu-west-1-746890340422-chef-traning/chef-client-13.0.118-1-x64.msi"
(New-Object System.Net.WebClient).DownloadFile($download_url, 'C:\\Windows\\Temp\\chef.msi')
Start-Process msiexec.exe -Wait -ArgumentList '/I C:\Windows\Temp\chef.msi /quiet ADDLOCAL="ChefClientFeature,ChefSchTaskFeature,ChefPSModuleFeature"'
(New-Object System.Net.WebClient).DownloadFile('https://s3-eu-west-1.amazonaws.com/aws-opsworks-cm-eu-west-1-746890340422-chef-traning/validator.pem', 'C:\\chef\\validation.pem')
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine")
(New-Object System.Net.WebClient).DownloadFile('https://s3-eu-west-1.amazonaws.com/aws-opsworks-cm-eu-west-1-746890340422-chef-traning/run_list.json', 'C:\\chef\\first_run.json')
Set-Content C:\chef\client.rb "log_level :debug"
Add-Content C:\chef\client.rb "`nssl_verify_mode :verify_none"
Add-Content C:\chef\client.rb "`nlog_location STDOUT"
Add-Content C:\chef\client.rb "`nchef_server_url  'https://my-chef-automate-xc1vqknfkzjt4seu.eu-west-1.opsworks-cm.io/organizations/dev'"
Add-Content C:\chef\client.rb "`nvalidation_client_name 'dev-validator'"
chef-service-manager -a install
knife ssl fetch 'https://my-chef-automate-xc1vqknfkzjt4seu.eu-west-1.opsworks-cm.io:8443'
Set-Content C:\chef\knife.rb "chef_server_url 'https://my-chef-automate-xc1vqknfkzjt4seu.eu-west-1.opsworks-cm.io/organizations/dev'"
Add-Content C:\chef\knife.rb "`nssl_verify_mode :verify_none"
Add-Content C:\chef\knife.rb "`nvalidation_client_name 'dev-validator'"
Add-Content C:\chef\knife.rb "`nconfig_log_level :debug"
cd C:\chef
chef-client --json-attributes first_run.json
Start-Sleep -s 60
chef-service-manager -a start
</powershell>
