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
10 changes: 9 additions & 1 deletion Invoke-PraRemoteMailbox.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
16 changes: 16 additions & 0 deletions tests/PraRemoteMailbox.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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(?<Text>.*?)(?=^## |\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(?<Text>.*?)(?=\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'
Expand Down
Loading