Created
December 6, 2014 20:31
-
-
Save guitarrapc/7a7f38a5b63ddc28dff9 to your computer and use it in GitHub Desktop.
PowerShell DSC Advent Calendar 2014 : Day 3 Chef と PowerShell DSC のこれまでと用語まとめ http://tech.guitarrapc.com/entry/2014/12/03/064417 : https://github.com/guitarrapc/DSCSample/blob/master/PowerShellDSCAdventCalendar/2014/Day3_HistoryOfChefAndPowerShellDSC_Words/Chef_PowerShellCookbook.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Do you think is work? NO........ | |
powershell_script "executionpolicy" do | |
code 'Set-ExecutionPolicy RemoteSigned' | |
not_if "(Get-ExecutionPolicy -Scope LocalMachine) -eq 'RemoteSiggned'" | |
end | |
powershell_script "smbsharelogs" do | |
code 'New-SMBShare logshare C:\logs' | |
not_if 'Get-SMBShare logshare' | |
end | |
# To work with x64..... awful | |
powershell_script "executionpolicy" do | |
code 'Set-ExecutionPolicy RemoteSigned' | |
not_if "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noprofile -executionpolicy bypass -command ((Get-ExecutionPolicy -Scope LocalMachine) -eq 'RemoteSiggned')" | |
end | |
powershell_script "smbsharelogs" do | |
code 'New-SMBShare logshare C:\logs' | |
not_if "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noprofile -executionpolicy bypass -command (Get-SMBShare logshare)" | |
end | |
# using guard Interpreter to make it in x64 | |
powershell_script "executionpolicy" do | |
guitad_interpreter :powershell_script | |
code 'Set-ExecutionPolicy RemoteSigned' | |
not_if "(Get-ExecutionPolicy -Scope LocalMachine) -eq 'RemoteSiggned'" | |
end | |
powershell_script "smbsharelogs" do | |
guitad_interpreter :powershell_script | |
code 'New-SMBShare logshare C:\logs' | |
not_if 'Get-SMBShare logshare' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment