when running the chef-run command are you in the mysimplebook directory or in it's parent directory? When using chef-run and specifying a cookbook you either have to give it the full path or it'll look for a folder by the name of the cookbook in the current working directory or in a directory specified in your knife config.rb cookbook_paths option.
#
# Cookbook:: windows_install_MSSQL_powershell_DSC
# Recipe:: default
#
# Copyright:: 2023, The Authors, All Rights Reserved.
powershell_script 'Prepare Machine for DSC' do
code <<-EOH
Set-PSRepository -InstallationPolicy Trusted -Name PSGallery
Install-Module -Name SqlServerDsc
Install-Module -Name SqlServer
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
EOH
end
file 'c:\\test\\testtest.txt' do
content 'This is a test file'
rights :full_control, 'WINDOMAIN.pavel\\administrator'
action :create
end
cookbook_file 'c:\\test\\create_mof_file.ps1' do
source 'create_mof_file.ps1'
action :create
end