Skip to content

Commit 158dfdb

Browse files
committed
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
2 parents e515ea9 + 5c624bc commit 158dfdb

File tree

996 files changed

+378941
-229424
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

996 files changed

+378941
-229424
lines changed

ChangeLog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@
5151
* Set-AzureVMSqlServerExtension
5252
* Get-AzureVMSqlServerExtension
5353
* Remove-AzureVMSqlServerExtension
54+
* Azure SQL Database Index Recommendation Cmdlets
55+
* Get-AzureSqlDatabaseIndexRecommendations
56+
* Start-AzureSqlDatabaseExecuteIndexRecommendation
57+
* Stop-AzureSqlDatabaseExecuteIndexRecommendation
58+
* Azure SQL Database and Server Upgrade Hints Cmdlets
59+
* Get-AzureSqlDatabaseUpgradeHint
60+
* Get-AzureSqlServerUpgradeHint
5461

5562
## 2015.08.17 version 0.9.7
5663
* Azure Profile cmdlets

setup-powershellget/Setup/ShortcutStartup.ps1

Lines changed: 46 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
# See the License for the specific language governing permissions and
1212
# limitations under the License.
1313
# ----------------------------------------------------------------------------------
14-
[CmdletBinding()]
14+
[CmdletBinding(DefaultParametersetName="none")]
1515
Param(
16-
[Parameter(Mandatory=$False, HelpMessage="Use Install parameter to install Azure modules from PowerShell Gallery.")]
17-
[switch]$Install
16+
[Parameter(Mandatory=$True, HelpMessage="Use Install parameter to install Azure modules from PowerShell Gallery.", ParameterSetName="install")]
17+
[switch]$Install,
18+
[Parameter(Mandatory=$True, HelpMessage="Use Uninstall parameter to uninstall Azure modules from PowerShell Gallery.", ParameterSetName="uninstall")]
19+
[switch]$Uninstall
1820
)
1921

2022
function EnsureRegistryPath
@@ -35,11 +37,10 @@ function EnsureRegistryPath
3537
$error.clear()
3638
try {
3739
if ($Install.IsPresent) {
38-
EnsureRegistryPath
3940
Write-Output @"
4041
4142
Finalizing installation of Azure PowerShell.
42-
Installing Azure Modules from PowerShell Gallery.
43+
Installing AzureRM Modules from PowerShell Gallery.
4344
This may take some time...
4445
"@
4546
$env:PSModulePath = "$env:USERPROFILE\Documents\WindowsPowerShell\Modules;$env:ProgramFiles\WindowsPowerShell\Modules;$env:SystemRoot\system32\WindowsPowerShell\v1.0\Modules\"
@@ -50,14 +51,47 @@ This may take some time...
5051

5152
Import-Module PowerShellGet
5253

53-
Install-Module AzureRM
54-
Write-Output "AzureRM $((Get-InstalledModule -Name AzureRM)[0].Version) installed..."
55-
Update-AzureRM
56-
} else {
54+
$DefaultPSRepository = $env:DefaultPSRepository
55+
if ([string]::IsNullOrWhiteSpace($DefaultPSRepository))
56+
{
57+
$DefaultPSRepository = "PSGallery"
58+
}
59+
60+
$_InstallationPolicy = (Get-PSRepository -Name $DefaultPSRepository).InstallationPolicy
61+
try
62+
{
63+
Set-PSRepository -Name $DefaultPSRepository -InstallationPolicy Trusted
64+
65+
Install-Module AzureRM -Repository $DefaultPSRepository
66+
Write-Output "AzureRM $((Get-InstalledModule -Name AzureRM)[0].Version) installed..."
67+
68+
Update-AzureRM -Repository $DefaultPSRepository
69+
} finally {
70+
# Clean up
71+
Set-PSRepository -Name $DefaultPSRepository -InstallationPolicy $_InstallationPolicy
72+
}
73+
}
74+
elseif ($Uninstall.IsPresent)
75+
{
76+
Write-Output @"
77+
78+
Finalizing uninstallation of Azure PowerShell.
79+
This may take some time...
80+
"@
81+
$env:PSModulePath = "$env:USERPROFILE\Documents\WindowsPowerShell\Modules;$env:ProgramFiles\WindowsPowerShell\Modules;$env:SystemRoot\system32\WindowsPowerShell\v1.0\Modules\"
82+
83+
Uninstall-AzureRM
84+
Uninstall-Module -Name AzureRM -Confirm:$false -Force
85+
}
86+
else
87+
{
5788
cd c:\
5889
$welcomeMessage = @"
59-
For a list of all Azure cmdlets type 'help azure'.
60-
For a list of Azure Pack cmdlets type 'Get-Command *wapack*'.
90+
For a list of all Azure RM cmdlets type 'help azurerm'.
91+
92+
To start using Azure RM login via Login-AzureRmAccount cmdlet.
93+
To switch between subscriptions use Set-AzureRmContext.
94+
For more details, see http://aka.ms/azps-getting-started.
6195
6296
To use Azure Service Management cmdlets please execute the following cmdlet:
6397
Install-Module Azure
@@ -72,6 +106,6 @@ catch
72106
Write-Output "An error occured during installation."
73107
Write-Output $error
74108
Write-Output "Press any key..."
75-
$host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
109+
$key = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
76110
}
77111

setup-powershellget/azurecmd.wxs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,14 @@
9797
<CustomAction Id="UpdatePSShortcut" BinaryKey="CustomActions" DllEntry="UpdatePSShortcut" Execute ="deferred" Impersonate="no"/>
9898
<CustomAction Id="SetExecutionPolicy" Property="POWERSHELLEXE" ExeCommand="-NoLogo -NoProfile -Command &quot;Set-ExecutionPolicy RemoteSigned -Force&quot;" Execute="deferred" Impersonate="no" Return="check"/>
9999
<CustomAction Id="RunModuleInstallScript" Property="POWERSHELLEXE" ExeCommand="-NoLogo -NoProfile -Command &quot;. \&quot;[PowerShellFolder]\ShortcutStartup.ps1\&quot; -Install&quot;" Execute="deferred" Impersonate="no" Return="check"/>
100+
<CustomAction Id="RunModuleUninstallScript" Property="POWERSHELLEXE" ExeCommand="-NoLogo -NoProfile -Command &quot;. \&quot;[PowerShellFolder]\ShortcutStartup.ps1\&quot; -Uninstall&quot;" Execute="deferred" Impersonate="no" Return="check"/>
100101

101102
<InstallExecuteSequence>
102103
<Custom Action="SetCustomActionDataValue" After="CreateShortcuts">NOT Installed</Custom>
103104
<Custom Action="UpdatePSShortcut" After="SetCustomActionDataValue">NOT Installed</Custom>
104105
<Custom Action="SetExecutionPolicy" After="UpdatePSShortcut">NOT Installed</Custom>
105106
<Custom Action="RunModuleInstallScript" After="SetExecutionPolicy">NOT Installed</Custom>
107+
<Custom Action="RunModuleUninstallScript" After="InstallInitialize">(NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL")</Custom>
106108
</InstallExecuteSequence>
107109

108110
<WixVariable Id="WixUILicenseRtf" Value="$(var.ProjectDir)\media\License.rtf" />

0 commit comments

Comments
 (0)