Skip to content

Commit 409e636

Browse files
committed
Merge branch 'dev' of github.com:Azure/azure-powershell into script
Conflicts: src/ResourceManager/Profile/Commands.Profile.Test/Commands.Profile.Test.csproj
2 parents 392af20 + 5c9d426 commit 409e636

File tree

757 files changed

+343435
-228599
lines changed

Some content is hidden

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

757 files changed

+343435
-228599
lines changed

AzurePowershell.Test.targets

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@
216216
</Target>
217217

218218
<!-- Run the scenario tests -->
219-
<Target Name="ScenarioTest" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
219+
<Target Name="ScenarioTest" DependsOnTargets="Clean;Build;BeforeRunTests">
220220
<Message Importance="high" Text="Running scenario tests..." />
221221
<MSBuild Targets="InvokeMSTest"
222222
Properties="_testAssembly=$(ScenarioTestDebug);_testSettings=$(TestSettings);_testFilter=$(ScenarioTestFilter);_testResult=$(TestOutputDirectory)\ScenarioTestDebug.trx"
@@ -275,7 +275,7 @@
275275
IncludeTraits="$(XUnitIncludedTrait)" MaxParallelThreads="0" ParallelizeAssemblies="false" ParallelizeTestCollections="false" />
276276
</Target>
277277

278-
<Target Name="RunOneSDKCIT" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
278+
<Target Name="RunOneSDKCIT" DependsOnTargets="Clean;Build;BeforeRunTests">
279279
<Message Importance="high" Text="Running CIT Scenario tests..." />
280280
<Delete Files="$(TestOutputDirectory)\RunOneSDKCITDebug.trx" />
281281
<Exec
@@ -284,47 +284,47 @@
284284
</Target>
285285

286286
<!-- Run the AzureRT tests -->
287-
<Target Name="AzureRTBVTs" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
287+
<Target Name="AzureRTBVTs" DependsOnTargets="Clean;Build;BeforeRunTests">
288288
<Message Importance="high" Text="Running AzureRT BVT tests..." />
289289
<Delete Files="$(TestOutputDirectory)\RTBVTDebug.trx" />
290290
<Exec
291291
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(AzureRTTestSettings) /category:BVT /resultsfile:$(TestOutputDirectory)\RTBVTDebug.trx"
292292
ContinueOnError="false" />
293293
</Target>
294294

295-
<Target Name="AzureRTOne" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
295+
<Target Name="AzureRTOne" DependsOnTargets="Clean;Build;BeforeRunTests">
296296
<Message Importance="high" Text="Running a specific tests..." />
297297
<Delete Files="$(TestOutputDirectory)\RTFunctionalDebug.trx" />
298298
<Exec
299299
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(AzureRTSeqTestSettings) /test:$(TestName) /resultsfile:$(TestOutputDirectory)\RTFunctionalDebug.trx"
300300
ContinueOnError="false" />
301301
</Target>
302302

303-
<Target Name="AzureRTRepeat" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
303+
<Target Name="AzureRTRepeat" DependsOnTargets="Clean;Build;BeforeRunTests">
304304
<Message Importance="high" Text="Running a specific tests..." />
305305
<Delete Files="$(TestOutputDirectory)\RTFunctionalDebug.trx" />
306306
<Exec
307307
Command="for /l %%x in (1, 1, $(RepeatTimes)) do MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(AzureRTTestSettings) /test:$(TestName) /resultsfile:$(TestOutputDirectory)\RTFunctionalDebug%%x.trx"
308308
ContinueOnError="false" />
309309
</Target>
310310

311-
<Target Name="AzureRTMulti" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
311+
<Target Name="AzureRTMulti" DependsOnTargets="Clean;Build;BeforeRunTests">
312312
<Message Importance="high" Text="Running tests:" />
313313
<Delete Files="$(TestOutputDirectory)\RTFunctionalDebug.trx" />
314314
<Exec
315315
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(AzureRTSeqTestSettings) $(TestParams) /resultsfile:$(TestOutputDirectory)\RTFunctionalDebug.trx"
316316
ContinueOnError="false" />
317317
</Target>
318318

319-
<Target Name="AzureRTAll" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
319+
<Target Name="AzureRTAll" DependsOnTargets="Clean;Build;BeforeRunTests">
320320
<Message Importance="high" Text="Running AzureRT all tests..." />
321321
<Delete Files="$(TestOutputDirectory)\RTDebug.trx" />
322322
<Exec
323323
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(AzureRTSeqTestSettings) /category:$(AzureRTAllTestFilter) /resultsfile:$(TestOutputDirectory)\RTDebug.trx"
324324
ContinueOnError="false" />
325325
</Target>
326326

327-
<Target Name="AzureRTAllFast" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
327+
<Target Name="AzureRTAllFast" DependsOnTargets="Clean;Build;BeforeRunTests">
328328
<Message Importance="high" Text="Running AzureRT all tests..." />
329329

330330
<Delete Files="$(TestOutputDirectory)\RTSequentialDebug.trx" />
@@ -337,7 +337,7 @@
337337
ContinueOnError="false" />
338338
</Target>
339339

340-
<Target Name="AzureRTSeq" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
340+
<Target Name="AzureRTSeq" DependsOnTargets="Clean;Build;BeforeRunTests">
341341
<Message Importance="high" Text="Running AzureRT all tests..." />
342342

343343
<Delete Files="$(TestOutputDirectory)\RTSequentialDebug.trx" />
@@ -346,7 +346,7 @@
346346
ContinueOnError="true" />
347347
</Target>
348348

349-
<Target Name="AzureRTNetwork" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
349+
<Target Name="AzureRTNetwork" DependsOnTargets="Clean;Build;BeforeRunTests">
350350
<Message Importance="high" Text="Running AzureRT all tests..." />
351351

352352
<Delete Files="$(TestOutputDirectory)\RTSequentialDebug.trx" />
@@ -355,7 +355,7 @@
355355
ContinueOnError="false" />
356356
</Target>
357357

358-
<Target Name="AzureRTUploadSeq" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
358+
<Target Name="AzureRTUploadSeq" DependsOnTargets="Clean;Build;BeforeRunTests">
359359
<Message Importance="high" Text="Running AzureRT all tests..." />
360360

361361
<Delete Files="$(TestOutputDirectory)\RTSequentialDebug.trx" />
@@ -364,7 +364,7 @@
364364
ContinueOnError="false" />
365365
</Target>
366366

367-
<Target Name="AzureRTPar" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
367+
<Target Name="AzureRTPar" DependsOnTargets="Clean;Build;BeforeRunTests">
368368
<Message Importance="high" Text="Running AzureRT all tests..." />
369369

370370
<Delete Files="$(TestOutputDirectory)\RTDebug.trx" />
@@ -373,7 +373,7 @@
373373
ContinueOnError="false" />
374374
</Target>
375375

376-
<Target Name="AzureRTFunctional" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
376+
<Target Name="AzureRTFunctional" DependsOnTargets="Clean;Build;BeforeRunTests">
377377
<Message Importance="high" Text="Running AzureRT Functional tests..." />
378378

379379
<Delete Files="$(TestOutputDirectory)\RTFunctionalDebug.trx" />
@@ -382,7 +382,7 @@
382382
ContinueOnError="false" />
383383
</Target>
384384

385-
<Target Name="AzureRTScenario" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
385+
<Target Name="AzureRTScenario" DependsOnTargets="Clean;Build;BeforeRunTests">
386386
<Message Importance="high" Text="Running AzureRT Scenario tests..." />
387387

388388
<Delete Files="$(TestOutputDirectory)\RTScenarioDebug.trx" />
@@ -391,7 +391,7 @@
391391
ContinueOnError="false" />
392392
</Target>
393393

394-
<Target Name="AzureRTAllPreview" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
394+
<Target Name="AzureRTAllPreview" DependsOnTargets="Clean;Build;BeforeRunTests">
395395
<Message Importance="high" Text="Running AzureRT all tests..." />
396396
<Delete Files="$(TestOutputDirectory)\RTAddVhdDebug.trx" />
397397
<Delete Files="$(TestOutputDirectory)\RTDebug.trx" />
@@ -403,23 +403,23 @@
403403
ContinueOnError="false" />
404404
</Target>
405405

406-
<Target Name="AzureRTPreview" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
406+
<Target Name="AzureRTPreview" DependsOnTargets="Clean;Build;BeforeRunTests">
407407
<Message Importance="high" Text="Running AzureRT all tests..." />
408408
<Delete Files="$(TestOutputDirectory)\RTPreviewDebug.trx" />
409409
<Exec
410410
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(AzureRTTestSettings) /category:Preview /resultsfile:$(TestOutputDirectory)\RTPreviewDebug.trx"
411411
ContinueOnError="false" />
412412
</Target>
413413

414-
<Target Name="AzureRTCleanUp" DependsOnTargets="Clean;BuildDebug;BeforeRunTests">
414+
<Target Name="AzureRTCleanUp" DependsOnTargets="Clean;Build;BeforeRunTests">
415415
<Message Importance="high" Text="Running AzureRT clean up tests..." />
416416
<Delete Files="$(TestOutputDirectory)\RTCleanUpDebug.trx" />
417417
<Exec
418418
Command="MSTest.exe /testcontainer:$(AzureRTTestContainer) /testsettings:$(AzureRTTestSettings) /category:AzureRTCleanUp /resultsfile:$(TestOutputDirectory)\RTCleanUpDebug.trx"
419419
ContinueOnError="false" />
420420
</Target>
421421

422-
<Target Name="ComputeCodeCoverage" DependsOnTargets="ForceRestorePackages;Clean;BuildDebug">
422+
<Target Name="ComputeCodeCoverage" DependsOnTargets="RestoreNugetPackages;Clean;Build">
423423
<Message Importance="high" Text="Gathering Code Coverage data from Compute tests..." />
424424
<Delete Files="Project.covarage" />
425425
<Exec

setup-powershellget/Setup/ShortcutStartup.ps1

Lines changed: 31 additions & 9 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,16 +51,37 @@ This may take some time...
5051

5152
Import-Module PowerShellGet
5253

53-
Install-Module AzureRM
54+
$DefaultPSRepository = $env:DefaultPSRepository
55+
if ([string]::IsNullOrWhiteSpace($DefaultPSRepository))
56+
{
57+
$DefaultPSRepository = "PSGallery"
58+
}
59+
60+
Install-Module AzureRM -Repository $DefaultPSRepository
5461
Write-Output "AzureRM $((Get-InstalledModule -Name AzureRM)[0].Version) installed..."
55-
Update-AzureRM
56-
} else {
62+
63+
Update-AzureRM -Repository $DefaultPSRepository
64+
}
65+
elseif ($Uninstall.IsPresent)
66+
{
67+
Write-Output @"
68+
69+
Finalizing uninstallation of Azure PowerShell.
70+
This may take some time...
71+
"@
72+
$env:PSModulePath = "$env:USERPROFILE\Documents\WindowsPowerShell\Modules;$env:ProgramFiles\WindowsPowerShell\Modules;$env:SystemRoot\system32\WindowsPowerShell\v1.0\Modules\"
73+
74+
Uninstall-AzureRM
75+
}
76+
else
77+
{
5778
cd c:\
5879
$welcomeMessage = @"
5980
For a list of all Azure RM cmdlets type 'help azurerm'.
6081
6182
To start using Azure RM login via Login-AzureRmAccount cmdlet.
6283
To switch between subscriptions use Set-AzureRmContext.
84+
For more details, see http://aka.ms/azps-getting-started.
6385
6486
To use Azure Service Management cmdlets please execute the following cmdlet:
6587
Install-Module Azure
@@ -74,6 +96,6 @@ catch
7496
Write-Output "An error occured during installation."
7597
Write-Output $error
7698
Write-Output "Press any key..."
77-
$host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
99+
$key = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
78100
}
79101

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)