-
Notifications
You must be signed in to change notification settings - Fork 119
/
Install-AppInsightsStatusMonitor.ps1
39 lines (32 loc) · 1.37 KB
/
Install-AppInsightsStatusMonitor.ps1
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
37
38
39
Configuration AppInsightsConfig
{
Node localhost
{
Script WebPi_Download
{
SetScript = 'Invoke-WebRequest -Uri "http://go.microsoft.com/fwlink/?LinkId=255386" -OutFile "${env:TEMP}\webpilauncher.exe"'
TestScript = '((Get-ChildItem -Path ${env:TEMP}\webpilauncher.exe -ErrorAction SilentlyContinue).Exists -eq $True)'
GetScript = '@{Ensure = if ((Get-ChildItem -Path ${env:TEMP}\webpilauncher.exe -ErrorAction SilentlyContinue).Exists -eq $True) {"Present"} else {"Absent"}'
}
Package WebPi_Installation
{
Ensure = "Present"
Name = "Microsoft Web Platform Installer 5.0"
Path = "${env:TEMP}\webpilauncher.exe"
ProductId = "4D84C195-86F0-4B34-8FDE-4A17EB41306A"
Arguments = ""
DependsOn = @("[Script]WebPi_Download")
}
Package AppInsights_Installation
{
Ensure = "Present"
Name = "Application Insights Status Monitor"
Path = "${env:ProgramFiles}\Microsoft\Web Platform Installer\WebPiCmd-x64.exe"
ProductId = ""
Arguments = "/install /products:ApplicationInsightsStatusMonitor /AcceptEula"
DependsOn = @("[Package]WebPi_Installation")
}
}
}
AppInsightsConfig
Start-DscConfiguration -Path .\AppInsightsConfig -Wait -Force