Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions package/Invoke-XTapSharingMigration.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@
Exit codes : 0 = success, 1 = failure, 2 = finished with items to look at (blocked, skipped, not verified,
or cancelled at the confirmation).
Documentation : docs\XTapSharingMigration-Guide.md (or .html)

This Script is a Personal project.
It's provided "AS-IS". It's not an official Microsoft product so no support can be expected from Microsoft.

As any scripts you must read carefully the documentation and test it first in a Test environment before any run in Production.

Coordinate every cutover with the partner organizations.
#>
[CmdletBinding()]
param(
Expand Down
9 changes: 9 additions & 0 deletions package/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,12 @@ notepad .\config\XTapSharingMigration.config.psd1 # Tenant.TenantId, Te
Project page, releases and change log: https://github.com/Nico77600/XTapSharingMigration

License: [MIT](LICENSE).

## Disclaimer

This Script is a Personal project.
It's provided "AS-IS". It's not an official Microsoft product so no support can be expected from Microsoft.

As any scripts you must read carefully the documentation and test it first in a Test environment before any run in Production.

Coordinate every cutover with the partner organizations.
27 changes: 27 additions & 0 deletions tests/XTapSharingMigration.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,33 @@ AfterAll {
if ($script:Work -and (Test-Path $script:Work)) { Remove-Item $script:Work -Recurse -Force -ErrorAction SilentlyContinue }
}

Describe 'Disclaimer synchronization' {
BeforeAll {
$script:DisclaimerPattern = '(?ms)^## Disclaimer\r?\n(?<Text>.*?)(?=^## |\z)'
$sections = [regex]::Matches((Get-Content (Join-Path $script:RepoRoot 'README.md') -Raw), $script:DisclaimerPattern)
if ($sections.Count -ne 1) { throw 'The root README must have exactly one Disclaimer section.' }
$script:Disclaimer = ($sections[0].Groups['Text'].Value -replace "`r`n", "`n").Trim()
}

It 'ships the complete root disclaimer in the runtime README' {
$sections = [regex]::Matches((Get-Content (Join-Path $script:Root 'README.md') -Raw), $script:DisclaimerPattern)
$sections.Count | Should -Be 1
($sections[0].Groups['Text'].Value -replace "`r`n", "`n").Trim() | Should -BeExactly $script:Disclaimer
}

It 'includes the complete root disclaimer in the entry script help notes' {
$errors = $null
$ast = [Management.Automation.Language.Parser]::ParseFile((Join-Path $script:Root 'Invoke-XTapSharingMigration.ps1'), [ref]$null, [ref]$errors)
$errors | Should -BeNullOrEmpty
$help = $ast.GetHelpContent()
$help | Should -Not -BeNullOrEmpty
$notes = ($help.Notes -replace "`r`n", "`n" -replace '(?m)^[ \t]+', '').Trim()
$start = $notes.IndexOf(($script:Disclaimer -split "`n")[0], [StringComparison]::Ordinal)
$start | Should -BeGreaterOrEqual 0
$notes.Substring($start) | Should -BeExactly $script:Disclaimer
}
}

Describe 'Configuration' {
It 'loads the delivered configuration file with fictitious tenant values' {
$script:Settings.Tenant.TenantId | Should -Be $TestTenant.Id
Expand Down
Loading