From dbd09f0b5e46045400f3d8cb94af942788cc8c9b Mon Sep 17 00:00:00 2001 From: Chris <23340053+isjwuk@users.noreply.github.com> Date: Tue, 18 Jun 2024 14:50:54 +0100 Subject: [PATCH] Removed "exit" from Copy-ContentLibrary Replaced "exit" with "break" in Copy-ContentLibrary to prevent entire PowerShell window from closing when you specify an incorrect Source Library. Now in line with other adjacent checks which use "break". --- Modules/ContentLibrary/ContentLibrary.psm1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/ContentLibrary/ContentLibrary.psm1 b/Modules/ContentLibrary/ContentLibrary.psm1 index 3443897c..7c979a05 100644 --- a/Modules/ContentLibrary/ContentLibrary.psm1 +++ b/Modules/ContentLibrary/ContentLibrary.psm1 @@ -526,7 +526,7 @@ Function Copy-ContentLibrary { $sourceLibraryId = (Get-ContentLibrary -LibraryName $SourceLibraryName).Id if($sourceLibraryId -eq $null) { Write-Host -ForegroundColor red "Unable to find Source Content Library named $SourceLibraryName" - exit + break } $destinationLibraryId = (Get-ContentLibrary -LibraryName $DestinationLibraryName).Id if($destinationLibraryId -eq $null) { @@ -777,4 +777,4 @@ Function New-SubscribedContentLibrary { Write-Host "Creating new Subscribed Content Library called $LibraryName ..." $library = $subscribeLibraryService.create($UniqueChangeId, $createSpec) } -} \ No newline at end of file +}