-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall.ps1
23 lines (18 loc) · 956 Bytes
/
install.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
$gitroot = "https://raw.githubusercontent.com/stopthatastronaut/ScheduledTaskDSC/master"
$diskroot = "c:\Program Files\windowspowershell\Modules\ScheduledTaskDSC"
if(-not (Test-Path $diskroot))
{
mkdir $diskroot
}
if(-not (Test-Path "$diskroot\DSCResources"))
{
mkdir "$diskroot\DSCResources"
}
if(-not (Test-Path "$diskroot\DSCResources\xScheduledTask"))
{
mkdir "$diskroot\DSCResources\xScheduledTask"
}
$client = [System.Net.WebClient]::new() # can't just invoke-webrequest, due to double-byte chars in github
$client.DownloadString("$gitroot/DSCResources/xScheduledTask/xScheduledTask.psm1") | Out-File "$diskroot\DSCResources\xScheduledTask\xScheduledTask.psm1"
$client.DownloadString("$gitroot/DSCResources/xScheduledTask/xScheduledTask.schema.mof") | Out-File "$diskroot\DSCResources\xScheduledTask\xScheduledTask.schema.mof"
$client.DownloadString("$gitroot/ScheduledTaskDSC.psd1") | Out-File "$diskroot\ScheduledTaskDSC.psd1"