diff --git a/package/Invoke-XTapSharingMigration.ps1 b/package/Invoke-XTapSharingMigration.ps1 index 770fc91..1a32c2f 100644 --- a/package/Invoke-XTapSharingMigration.ps1 +++ b/package/Invoke-XTapSharingMigration.ps1 @@ -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( diff --git a/package/README.md b/package/README.md index 24e99d8..4c1c1eb 100644 --- a/package/README.md +++ b/package/README.md @@ -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. diff --git a/tests/XTapSharingMigration.Tests.ps1 b/tests/XTapSharingMigration.Tests.ps1 index c69af22..8cec980 100644 --- a/tests/XTapSharingMigration.Tests.ps1 +++ b/tests/XTapSharingMigration.Tests.ps1 @@ -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(?.*?)(?=^## |\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