743983390e
* Capitalize 'Should' command and fix whitespace ```powershell $_ -ireplace '\s?\|\s?should\b',' | Should' ``` * Capitalise and apply hyphen to 'Not' parameter ```powershell $_ -ireplace '(\| Should) not\b','$1 -Not' ``` * Capitalise and apply hyphen to 'Be' parameter ```powershell $_ -ireplace '(\| Should(?: -Not)?) -?be\b','$1 -Be' ``` * Capitalise and apply hyphen to 'BeExactly' parameter $_ -ireplace '(\| Should(?: -Not)?) -?beexactly\b','$1 -BeExactly' * Capitalise and apply hyphen to 'BeGreaterThan' parameter ```powershell $_ -ireplace '(\| Should(?: -Not)?) -?begreaterthan\b','$1 -BeGreaterThan' ``` * Use 'BeTrue' parameter ```powershell $_ -ireplace '(\| Should(?: -Not)?) -Be\s\$?true\b','$1 -BeTrue' ``` * Use 'BeFalse' parameter ```powershell $_ -ireplace '(\| Should(?: -Not)?) -Be\s\$?false\b','$1 -BeFalse' ``` * Capitalise and apply hyphen to 'Match' parameter ```powershell $_ -ireplace '(\| Should(?: -Not)?)\s-?match\b','$1 -Match' ``` * Capitalise and apply hyphen to 'Throw' parameter ```powershell $_ -ireplace '(\| Should(?: -Not)?)\s-?throw\b','$1 -Throw' ``` * Capitalise and apply hyphen to 'BeNullOrEmpty' parameter ```powershell $_ -ireplace '(\| Should(?: -Not)?)\s-?benullorempty\b','$1 -BeNullOrEmpty' ``` * Capitalise 'Because' parameter ```powershell $_ -ireplace '\s-because\b',' -Because' ``` * Fix 'BeNullOrEmpty'
38 lines
1.6 KiB
PowerShell
38 lines
1.6 KiB
PowerShell
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
# Licensed under the MIT License.
|
|
Describe "Windows Installer" -Tags "Scenario" {
|
|
|
|
BeforeAll {
|
|
$skipTest = -not $IsWindows
|
|
$preRequisitesLink = 'https://aka.ms/pscore6-prereq'
|
|
$linkCheckTestCases = @(
|
|
@{ Name = "Universal C Runtime"; Url = $preRequisitesLink }
|
|
@{ Name = "WMF 4.0"; Url = "https://www.microsoft.com/download/details.aspx?id=40855" }
|
|
@{ Name = "WMF 5.0"; Url = "https://www.microsoft.com/download/details.aspx?id=50395" }
|
|
@{ Name = "WMF 5.1"; Url = "https://www.microsoft.com/download/details.aspx?id=54616" }
|
|
)
|
|
}
|
|
|
|
It "WiX (Windows Installer XML) file contains pre-requisites link $preRequisitesLink" -skip:$skipTest {
|
|
$wixProductFile = Join-Path -Path $PSScriptRoot -ChildPath "..\..\..\assets\Product.wxs"
|
|
(Get-Content $wixProductFile -Raw).Contains($preRequisitesLink) | Should -BeTrue
|
|
}
|
|
|
|
## Running 'Invoke-WebRequest' with WMF download URLs has been failing intermittently,
|
|
## because sometimes the URLs lead to a 'this download is no longer available' page.
|
|
## We use a retry logic here. Retry for 5 times with 1 second interval.
|
|
It "Pre-Requisistes link for '<Name>' is reachable: <url>" -TestCases $linkCheckTestCases -skip:$skipTest {
|
|
param ($Url)
|
|
|
|
foreach ($i in 1..5) {
|
|
try {
|
|
$result = Invoke-WebRequest $Url -UseBasicParsing
|
|
break;
|
|
} catch {
|
|
Start-Sleep -Seconds 1
|
|
}
|
|
}
|
|
|
|
$result | Should -Not -Be $null
|
|
}
|
|
}
|