fix debugging in vscode

This commit is contained in:
2026-08-24 11:05:21 +02:00
parent f18cd2c19d
commit ae98ffea79
3 changed files with 86 additions and 10 deletions
@@ -15,6 +15,10 @@ Directory for pre-write search-response backups.
.PARAMETER PageSize
Number of rows requested per search page. All reported pages are retrieved.
.PARAMETER RunWhenDotSourced
Runs the interactive workflow even when the script is dot-sourced. Intended for
debuggers such as the VS Code PowerShell debugger that dot-source launch scripts.
#>
[CmdletBinding()]
param(
@@ -28,7 +32,10 @@ param(
[Parameter()]
[ValidateRange(1, 1000)]
[int] $PageSize = 80
[int] $PageSize = 80,
[Parameter()]
[switch] $RunWhenDotSourced
)
Set-StrictMode -Version Latest
@@ -681,6 +688,6 @@ function Invoke-ElixFormsMetadataBulkUpdate {
}
}
if ($MyInvocation.InvocationName -ne '.') {
if ($MyInvocation.InvocationName -ne '.' -or $RunWhenDotSourced) {
Invoke-ElixFormsMetadataBulkUpdate -BaseUri $BaseUri -BackupDirectory $BackupDirectory -PageSize $PageSize
}