I started using DSC configuration on power shell using Windows PowerShell ISE for deployment activities. I have a Windows 2012 web server which has IIS installed on it. On this IIS server, I have 12 services installed and running.
Now I am updating the code bits of one of the services on this IIS. Before I do that; I want to stop the IIS if it is running. IS there any command for this?
I tried the below command, but it checks only abt the IIS:
WindowsFeature IIS
{
Ensure = "Present"
Name = "Web-Server"
}
What you probably should do is stop the default website as your configuration should describe the state you want. You shouldn't want to install IIS just to stop it, but you probably don't want the default site.
Here is a configuration to do that: