Created
July 14, 2015 16:20
-
-
Save ploegert/6017e1f9d4dd07825507 to your computer and use it in GitHub Desktop.
Publish DSC Config Source: https://msdn.microsoft.com/en-us/library/azure/dn877980.aspx
This file contains hidden or 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
| #File: C:\examples\IISInstall.ps1 | |
| configuration IISInstall | |
| { | |
| node ("localhost") | |
| { | |
| WindowsFeature IIS | |
| { | |
| Ensure = "Present" | |
| Name = "Web-Server" | |
| } | |
| } | |
| } | |
| #===================================================== | |
| Publish-AzureVMDscConfiguration -ConfigurationPath C:\examples\IISInstall.ps1 | |
| #===================================================== | |
| $vm = Set-AzureVMDSCExtension -VM $vm -ConfigurationArchive "IISInstall.ps1.zip" -ConfigurationName "IISInstall" |
This file contains hidden or 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 Main | |
| { | |
| param( | |
| [Parameter(Mandatory=$true)] | |
| [ValidateNotNullorEmpty()] | |
| [PSCredential] | |
| $Credential | |
| ) | |
| Node localhost { | |
| User LocalUserAccount | |
| { | |
| Username = $Credential.UserName | |
| Password = $Credential | |
| Disabled = $false | |
| Ensure = "Present" | |
| FullName = "Local User Account" | |
| Description = "Account for running Local Service" | |
| PasswordNeverExpires = $true | |
| } | |
| } | |
| } | |
| $configurationName = "Main" | |
| $configurationArguments = @{ Credential = Get-Credential } | |
| $configurationArchive = "user_configuration.ps1.zip" | |
| $vm = Set-AzureVMDSCExtension ` | |
| -VM $vm ` | |
| -ConfigurationArchive $configurationArchive ` | |
| -ConfigurationName $configurationName ` | |
| -ConfigurationArgument $configurationArguments |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment