Created
May 7, 2018 14:47
-
-
Save CodeHeight/c20386d61bb968e39d72c95b11a6f5ff to your computer and use it in GitHub Desktop.
DSC and Custom Scripts (Manageing Virtual Machines > Configuration Management Tools)
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
get-windowsfeature web-server | install-windowsfeature |
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
$resourceGroup = "vms" | |
$location = "eastus2" | |
$vmName = "configureme" | |
$storageName = "codeheightStore" | |
#Publish the configuration script into user storage | |
Publish-AzureRmVMDscConfiguration -ConfigurationPath .\webserverinstall.ps1 -ResourceGroupName $resourceGroup -StorageAccountName $storageName -force | |
#Set the VM to run the DSC configuration | |
Set-AzureRmVmDscExtension -Version 2.21 -ResourceGroupName $resourceGroup -VMName $vmName -ArchiveStorageAccountName $storageName -ArchiveBlobName webserverinstall.ps1.zip -AutoUpdate:$true -ConfigurationName "IISInstall" |
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
configuration IISInstall | |
{ | |
node "localhost" | |
{ | |
WindowsFeature IIS | |
{ | |
Ensure = "Present" | |
Name = "web-Server" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment