Skip to content

Instantly share code, notes, and snippets.

View bobalob's full-sized avatar

Dave Hall bobalob

View GitHub Profile

Installation

Install the Docker-Microsoft PackageManagement Provider from the PowerShell Gallery.

Install-Module -Name DockerMsftProvider -Repository PSGallery -Force

Install the latest version of Docker.

Install-Package -Name docker -ProviderName DockerMsftProvider
$connectionStringPri = @{
"Username"="admin";
"Password"="password";
"SpaIpAddress"="192.168.50.1";
"SpbIpAddress"="192.168.50.2";
"Port"="443";
"UserFriendlyName"="Primary SAN"
};
$connectionStringSec = @{
configuration DSCWebServer
{
Import-DSCResource -ModuleName 'xPSDesiredStateConfiguration'
node "localhost"
{
WindowsFeature IIS
{
Ensure = "Present"
Name = "Web-Server"
}
$resourceGroup = "DSC-Test-Resources"
$location = "northeu"
$vmName = "MyCoolVM"
$storageName = "dsctestresourcesdisks871"
#Publish the configuration script into user storage
Publish-AzureRmVMDscConfiguration -ConfigurationPath .\dsc-webserver.ps1 `
-ResourceGroupName $resourceGroup -StorageAccountName $storageName -force
#Set the VM to run the DSC configuration
configuration DSCWebServer
{
node "localhost"
{
WindowsFeature IIS
{
Ensure = "Present"
Name = "Web-Server"
}
}
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"masterPrefix": {
"type": "string",
"metadata": {
"description": "The prefix for all common resources in the deployment"
}
},
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"variables": {},
"resources": [
{
"type": "Microsoft.Compute/virtualMachines/extensions",
"name": "myVirtualMachine/deployscript",
"apiVersion": "2016-03-30",
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"publicIpNames": {
"type": "array",
"defaultValue": [
"dave-ninja-ip",
"dave-super-ip",
"dave-mega-ip"
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"variables": {},
"resources": [
{
"apiVersion": "2015-06-15",
"type": "Microsoft.Network/publicIPAddresses",
"name": "[concat('myPublicIp-', copyindex())]",
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"variables": {},
"resources": [
{
"apiVersion": "2015-06-15",
"type": "Microsoft.Network/publicIPAddresses",
"name": "testPublicIp",