-
Notifications
You must be signed in to change notification settings - Fork 26
/
UpdateScripts.ps1
40 lines (30 loc) · 1.34 KB
/
UpdateScripts.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
40
<#
.Synopsis
Copy this script to the root of your drive and execute to:
1. Pause scheduled tasks
2. Update the scripts from the github repository
3. Update any dependencies
4. Enable the scheduled tasks
Note you may see the following error during execution
git : From https://github.com/Azure-Samples/AzureStack-AdminPowerShell-OMSIntegration
At C:\UpdateScripts.ps1:18 char:1
+ git pull
+ ~~~~~~~~
+ CategoryInfo : NotSpecified: (From https://gi...-OMSIntegration:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
3bf49bb..6acc252 master -> origin/master
Updates to the scripts will happen despite this error.
#>
#Disable Scheduled Tasks
Disable-ScheduledTask -TaskName "UsageDataUpload1"
Disable-ScheduledTask -TaskName "OperationalDataUpload1"
#Add environment variable for Git
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
#Clone Github repository into existing working directory
cd C:\AZSAdminOMSInt
git pull "https://github.com/Azure-Samples/AzureStack-AdminPowerShell-OMSIntegration.git"
cd C:\AZSAdminOMSInt
& .\UpdateDependencies.ps1
#Enable Scheduled Tasks
Enable-ScheduledTask -TaskName "UsageDataUpload1"
Enable-ScheduledTask -TaskName "OperationalDataUpload1"