Using PS to create a extension that needs to do the following for right now.
1: Get zip 2: Unzip and copy into directory in C:\Scripts
Here is the PS to install the extension (this does infact create the extension in extensions under the scale set)
$dscConfig = @{
"wmfVersion" = "latest";
"configuration" = @{
"url" = "https://foo.blob.core.windows.net/dsc.zip";
"script" = "configure.ps1";
"function" = "AzureDscDemo";
};
}
$vmss = Get-AzVmss `
-ResourceGroupName "FooVmssResource" `
-VMScaleSetName "FooVmss"
$vmss = Add-AzVmssExtension `
-VirtualMachineScaleSet $vmss `
-Publisher Microsoft.Powershell `
-Type DSC `
-TypeHandlerVersion 2.24 `
-Name "DSC" `
-Setting $dscConfig
Update-AzVmss `
-ResourceGroupName "FooVmssResource" `
-Name "FooVmss" `
-VirtualMachineScaleSet $vmss
Now inside dsc.zip I have a script called configure.ps1 with a function called AzureDscDemo this is where I run into trouble. How do I take the zip file and save to the file path on the server and better yet unzip it.
Configuration AzureDscDemo {
Node Localhost {
File DscFile {
Type = "Directory"
Ensure = "Present"
DestinationPath = "C:\Scripts"
# Copy zip to scripts????
}
}
}