-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathInvoke-DscTest.ps1
More file actions
36 lines (32 loc) · 1.68 KB
/
Invoke-DscTest.ps1
File metadata and controls
36 lines (32 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Publish-AzVMDscConfiguration `
-ConfigurationPath "$PSScriptRoot/src/VmDsc/DomainController/DeployDC.ps1"`
-AdditionalPath "$PSScriptRoot/src/VmDsc/DomainController/additionaldata"`
-OutputArchivePath "$($env:TEMP)/DeployDC.ps1.zip" -Force
$st = Get-AzStorageAccount -ResourceGroupName "rg-sc4" -Name "stsccudhrprd001"
Write-Host "Uploading DeployDC.ps1.zip to Azure Storage Account: $($st.Name)"
Set-AzStorageBlobContent -Container "windows-powershell-dsc"`
-File "$($env:TEMP)/DeployDC.ps1.zip" `
-Blob "DeployDC.ps1.zip"`
-Context $st.Context -Force
$password = ConvertTo-SecureString "C0nt0s0!" -AsPlainText -Force
$adminCredential = New-Object System.Management.Automation.PSCredential ("local_admin",$password );
$configurationArguments = @{
adminCredential = $adminCredential
domainFQDN = "shieldchecker.local"
functionAppHostname = "fun-scc-udhr-westeurope-prd-001.azurewebsites.net"
}
Write-Host "Removing existing Deploy-DomainServices DSC extension if it exists"
Remove-AzVMDscExtension -ResourceGroupName "rg-sc4" -VMName "dc01" -Name "Deploy-DomainServices" -ErrorAction SilentlyContinue
Write-Host "Deploying Deploy-DomainServices DSC extension to VM dc01 in resource group rg-sc4"
Set-AzVMDscExtension `
-ResourceGroupName "rg-sc4" `
-Name "Deploy-DomainServices" `
-VMName "dc01" `
-ArchiveBlobName "DeployDC.ps1.zip" `
-ArchiveStorageAccountName "stsccudhrprd001" `
-ConfigurationArgument $configurationArguments `
-ConfigurationName "Deploy-DomainServices" `
-ArchiveContainerName "windows-powershell-dsc" `
-Version "2.77" `
-Location "westeurope" `
-AutoUpdate -NoWait