File tree Expand file tree Collapse file tree 2 files changed +22
-5
lines changed Expand file tree Collapse file tree 2 files changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -17,11 +17,28 @@ Param(
17
17
[switch ]$Install
18
18
)
19
19
20
- cd c:\
21
- $welcomeMessage = @"
20
+ $error.clear ()
21
+ try {
22
+ if ($Install.IsPresent ) {
23
+ Write-Output @" Installing Azure Modules from PowerShell Gallery.
24
+ This may take some time...
25
+
26
+ " @
27
+ Get-PackageProvider - Name NuGet - ForceBootstrap
28
+ Install-Module AzureRM.Installer
29
+ Install-AzureRM
30
+ } else {
31
+ cd c:\
32
+ $welcomeMessage = @"
22
33
For a list of all Azure cmdlets type 'help azure'.
23
34
For a list of Azure Pack cmdlets type 'Get-Command *wapack*'.
24
35
"@
25
- Write-Output $welcomeMessage
36
+ Write-Output $welcomeMessage
26
37
27
- $VerbosePreference = " Continue"
38
+ $VerbosePreference = " Continue"
39
+ }
40
+ }
41
+ catch { Write-Output $error }
42
+ if ($error ) {
43
+ Read-Host - Prompt " An error occured during installation. Press any key..."
44
+ }
Original file line number Diff line number Diff line change 102
102
<CustomAction Id =" SetCustomActionDataValue" Return =" check" Property =" UpdatePSShortcut"
103
103
Value =" ShortcutPath=[AzureSdkMenu]Microsoft Azure PowerShell.lnk;DefaultShortcutPath=[ProgramMenuFolder]System Tools\Windows PowerShell.lnk" />
104
104
<CustomAction Id =" SetExecutionPolicy" Property =" POWERSHELLEXE" ExeCommand =" -NoLogo -NoProfile -Command " Set-ExecutionPolicy RemoteSigned -Force" " Execute =" deferred" Impersonate =" no" Return =" check" />
105
- <CustomAction Id =" RunModuleInstallScript" Property =" POWERSHELLEXE" ExeCommand =" -NoLogo -NoProfile -Command " \" [PowerShellFolder]\ShortcutStartup.ps1 -Install \"" " Execute =" deferred" Impersonate =" no" Return =" check" />
105
+ <CustomAction Id =" RunModuleInstallScript" Property =" POWERSHELLEXE" ExeCommand =" -NoLogo -NoProfile -Command " . \" [PowerShellFolder]\ShortcutStartup.ps1\" -Install " " Execute =" deferred" Impersonate =" no" Return =" check" />
106
106
107
107
<InstallExecuteSequence >
108
108
<Custom Action =" SetCustomActionDataValue" After =" CreateShortcuts" >NOT Installed</Custom >
You can’t perform that action at this time.
0 commit comments