Note – in this program file “before-iis-install-stop.bat” & “after-iis-install-start.bat” & index.html is in same directory.
Step 1 – Write before-iis-install-stop.bat
@echo off
REM - File: before-iis-install-stop.bat
echo Restarting IIS...
echo ======================================================
net stop W3SVC
echo ======================================================
echo IIS Stopped
Step 2 -Write after-iis-install-start.bat
@echo off
REM - File: after-iis-install-start.bat
echo Restarting IIS...
echo ======================================================
net start W3SVC
echo ======================================================
echo IIS Restarted
Step 3 – Write appspec.yml
version: 0.0
os: windows
files:
- source: \index.html
destination: c:\inetpub\wwwroot
hooks:
BeforeInstall:
- location: \before-iis-install-stop.bat
timeout: 900
AfterInstall:
- location: \after-iis-install-start.bat
timeout: 180
I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I am working at Cotocus. I blog tech insights at DevOps School, travel stories at Holiday Landmark, stock market tips at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at I reviewed , and SEO strategies at Wizbrand.
Please find my social handles as below;
Rajesh Kumar Personal Website
Rajesh Kumar at YOUTUBE
Rajesh Kumar at INSTAGRAM
Rajesh Kumar at X
Rajesh Kumar at FACEBOOK
Rajesh Kumar at LINKEDIN
Rajesh Kumar at PINTEREST
Rajesh Kumar at QUORA
Rajesh Kumar at WIZBRAND