From 112f351d59197de9880a74e1a4e9d1788d0ab8a8 Mon Sep 17 00:00:00 2001 From: Nicolas Fabert <195452170+Nico77600@users.noreply.github.com> Date: Mon, 12 Oct 2026 13:59:58 +0100 Subject: [PATCH] Align runtime disclaimer with project README --- Invoke-PraRemoteMailbox.ps1 | 10 +++++++++- tests/PraRemoteMailbox.Tests.ps1 | 16 ++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/Invoke-PraRemoteMailbox.ps1 b/Invoke-PraRemoteMailbox.ps1 index 6b56b73..0996461 100644 --- a/Invoke-PraRemoteMailbox.ps1 +++ b/Invoke-PraRemoteMailbox.ps1 @@ -115,7 +115,15 @@ 3.10+, Microsoft.Graph.Authentication and Microsoft.Graph.Users (cloud part), ADSync (sync). Exit codes : 0 = done, 1 = failed, 2 = done but a next step is required (Pending objects). Documentation : docs\PraRemoteMailbox-Guide.md (or .html) -#> + + 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. + + The tool changes production objects in Active Directory and creates mailboxes in Exchange Online: run the preview, review the plan, keep the backups and test in a lab before using it in a real disaster. +#> #Requires -Version 5.1 [CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'High', DefaultParameterSetName = 'Run')] param( diff --git a/tests/PraRemoteMailbox.Tests.ps1 b/tests/PraRemoteMailbox.Tests.ps1 index 33df4b1..381f3a7 100644 --- a/tests/PraRemoteMailbox.Tests.ps1 +++ b/tests/PraRemoteMailbox.Tests.ps1 @@ -600,6 +600,22 @@ exit `$code Import-Module (Join-Path $global:PraGate.Release 'module\PRA.Directory.psm1') -Force -Global } +Describe 'Runtime disclaimer' -Tag 'Disclaimer' { + It 'keeps public script help identical to the root runtime readme disclaimer' { + $readme = [IO.File]::ReadAllText((Join-Path $global:PraGate.Release 'README.md')).Replace("`r`n", "`n") + $sections = [regex]::Matches($readme, '(?ms)^## Disclaimer\n\n(?.*?)(?=^## |\z)') + $sections.Count | Should -Be 1 + $canonical = $sections[0].Groups['Text'].Value.TrimEnd([char[]]"`n") + $canonical | Should -Not -BeNullOrEmpty + + $entry = Join-Path $global:PraGate.Release 'Invoke-PraRemoteMailbox.ps1' + $notes = ((Get-Help $entry -Full).alertSet.alert.Text -join "`n").Replace("`r`n", "`n") + $disclaimers = [regex]::Matches($notes, '(?ms)^Disclaimer:\n(?.*?)(?=\n\nRequires -Version|\z)') + $disclaimers.Count | Should -Be 1 + $disclaimers[0].Groups['Text'].Value.TrimEnd([char[]]"`n") | Should -BeExactly $canonical + } +} + Describe 'Directory internal invariants - synthetic modules only' { BeforeEach { $global:PraGate.Runtime=New-GateRuntime -Name 'unit'