Today while testing a custom Powershell script on a VM of an application group I ran into what I think is a bug.
Here's a test script to reproduce the bug:
Code: Select all
param (
[Parameter(Mandatory = $true)]
[string]$Text
)
Write-Output "Text value : $Text"
exit 0"Name : Test-Script1
Path : C:\Test-Script.ps1
Argument : -Text 'Example with space'
If you call the script in this way, it will make an error (double quotes around the text passed as an argument):
Name : Test-Script2
Path : C:\Test-Script.ps1
Argument : -Text "Example with space"
Here's the error :
Code: Select all
[09.07.2025 15:57:52.041] <61> Info (3) [SureBackup] [SRV1] [ScriptTests] Process is starting with the following start info:
[09.07.2025 15:57:52.041] <61> Info (3) [SureBackup] [SRV1] [ScriptTests] > WorkingDirectory = C:\Program Files\Veeam\Backup and Replication\Backup
[09.07.2025 15:57:52.041] <61> Info (3) [SureBackup] [SRV1] [ScriptTests] > FileName = C:\Windows\system32\windowspowershell\v1.0\powershell.exe
[09.07.2025 15:57:52.892] <53> Info (3) [SureBackup] [SRV1] [ScriptTests] [Console] C:\Test-Script.ps1 : Impossible de trouver un paramètre positionnel acceptant l'argument « with ».
[09.07.2025 15:57:52.892] <53> Info (3) [SureBackup] [SRV1] [ScriptTests] [Console] Au caractère Ligne:1 : 1
[09.07.2025 15:57:52.892] <53> Info (3) [SureBackup] [SRV1] [ScriptTests] [Console] + C:\Test-Script.ps1 -Text Example with space
[09.07.2025 15:57:52.892] <53> Info (3) [SureBackup] [SRV1] [ScriptTests] [Console] + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[09.07.2025 15:57:52.892] <53> Info (3) [SureBackup] [SRV1] [ScriptTests] [Console] + CategoryInfo : InvalidArgument : (:) [Simple-Test.ps1], ParameterBindingException
[09.07.2025 15:57:52.892] <53> Info (3) [SureBackup] [SRV1] [ScriptTests] [Console] + FullyQualifiedErrorId : PositionalParameterNotFound,Simple-Test.ps1If you call the script directly from the VBR server's Powershell prompt, there's no problem with double quotes around text containing spaces.
Has anyone ever encountered this bug?
Thank you