Created
June 21, 2015 01:54
-
-
Save vinyar/6272e725c2598a8ff0c8 to your computer and use it in GitHub Desktop.
a powershell script to run through cookbooks migrated from chef server (10) and find the ones here metadata.rb cookbook names doesnt match folder name
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
############## identifying cookbooks where metadata does not match folder name | |
dir | %{$folder=$_.basename -replace '-\d{1,}.\d{1,}.\d{1,}' | |
$meta_name= (cat $_\metadata.rb|select-string "name ") -replace 'name {1,}' -replace "'" | |
if ($folder -ne $meta_name){write-host $folder} | |
} | |
dir role_chef_client_* | %{$_.basename -replace '-\d{1,}.\d{1,}.\d{1,}'} | |
dir role_chef_client_* | %{(cat $_\metadata.rb|select-string "name ") -replace 'name {1,}' -replace "'"} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment