Skip to content

Commit 4e303e7

Browse files
committed
[#103628912] Added installation script
1 parent 09cd46d commit 4e303e7

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

setup-powershellget/Setup/ShortcutStartup.ps1

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,28 @@ Param(
1717
[switch]$Install
1818
)
1919

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 = @"
2233
For a list of all Azure cmdlets type 'help azure'.
2334
For a list of Azure Pack cmdlets type 'Get-Command *wapack*'.
2435
"@
25-
Write-Output $welcomeMessage
36+
Write-Output $welcomeMessage
2637

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+
}

setup-powershellget/azurecmd.wxs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
<CustomAction Id="SetCustomActionDataValue" Return="check" Property="UpdatePSShortcut"
103103
Value="ShortcutPath=[AzureSdkMenu]Microsoft Azure PowerShell.lnk;DefaultShortcutPath=[ProgramMenuFolder]System Tools\Windows PowerShell.lnk" />
104104
<CustomAction Id="SetExecutionPolicy" Property="POWERSHELLEXE" ExeCommand="-NoLogo -NoProfile -Command &quot;Set-ExecutionPolicy RemoteSigned -Force&quot;" Execute="deferred" Impersonate="no" Return="check"/>
105-
<CustomAction Id="RunModuleInstallScript" Property="POWERSHELLEXE" ExeCommand="-NoLogo -NoProfile -Command &quot;\&quot;[PowerShellFolder]\ShortcutStartup.ps1 -Install\&quot;&quot;" Execute="deferred" Impersonate="no" Return="check"/>
105+
<CustomAction Id="RunModuleInstallScript" Property="POWERSHELLEXE" ExeCommand="-NoLogo -NoProfile -Command &quot;. \&quot;[PowerShellFolder]\ShortcutStartup.ps1\&quot; -Install&quot;" Execute="deferred" Impersonate="no" Return="check"/>
106106

107107
<InstallExecuteSequence>
108108
<Custom Action="SetCustomActionDataValue" After="CreateShortcuts">NOT Installed</Custom>

0 commit comments

Comments
 (0)