- From: Kenneth Barry <
>
- To: "
" <
>
- Cc: sachin kumar <
>
- Subject: [chef] Re: Converting batch script to chef
- Date: Tue, 13 Jan 2015 06:48:50 -0800
Can you tell us in lay mans terms what that script accomplishes? There is a
chance this is either done in another cookbook, or it would be better to
create an lwrp.
Sent from my iPhone
>
On Jan 13, 2015, at 6:15 AM, Sachin Gupta
>
<
>
>
wrote:
>
>
Hello,
>
>
I am trying to convert a windows batch script into chef script. The
>
sample code is like below
>
>
:FindCurrentPagingFileSettingsC
>
wmic pagefileset list | findstr /i /c:"c:">nul
>
if not {%errorlevel%}=={0} set NoPagingFileC=true&goto
>
:FindCurrentPagingFileSettingsP
>
for /f "tokens=1-10 delims= " %%a in ('wmic pagefileset list ^| findstr
>
/i /c:"c:"') do (
>
set CurrentInitialPagingFileSizeMBC=%%d
>
set CurrentMaximumPagingFileSizeMBC=%%e
>
set CurrentPagingFileC=%%f
>
)
>
if defined CurrentPagingFileC (
>
for /f "tokens=1-10 delims=\" %%a in ('echo
>
%CurrentPagingFileC%') do set CurrentPagingFileCwmic=%%a\\%%b
>
)
>
>
I would like to know whether its good to write such code as
>
>
batch "FindCurrentPagingFileSettingsC" do
>
code <<-EOH
>
## here come the code
>
EOH
>
end
>
>
or first try to learn some ruby stuff and then write code in ruby. I am
>
new to ruby .
>
>
Any help would be great.
>
>
>
Thanks & Regards,
>
Sachin Gupta
>
Archive powered by MHonArc 2.6.16.