It still doesn’t work for us, even with version 2.4.0p22. Surely the commands for Veeam can’t be working like this?
You need to make sure that the agent plugin on your agents is updated as well. That only happens automatically if you have the agent bakery
Ok, Hello, it is the latest version. The plugin is also up to date. However, the script for Veeam still uses the old commands. Shouldn’t there be different commands there?
The change we introduced switches to Powershell 7 for Veeam versions 13 or higher. The commands remain the same. This switch is the important change
+$isNewVeeam = $veeamVersion -ge $borderVersion
+$isNewPowershell = $PSVersionTable.PSVersion.Major -ge 7
+
+try {
+ if ($isNewVeeam -and -not( $isNewPowershell) ) {
+ Write-Debug "Switch Powershell 7(core)"
+ pwsh $PSCommandPath @PSBoundParameters
+ exit 0
+ }
+
+ if (-not ($isNewVeeam) -and $isNewPowershell) {
+ Write-Debug "Switch to Powershell 5"
+ powershell $PSCommandPath @PSBoundParameters
+ exit 0
+ }
If this code snippet is in your agent plugin, then you have the right agent plugin. Then you just need to make sure that you have Powershell 7 installed on your system. That is the requirement set from Veeam 13 on by Veeam
Yes, PowerShell version 7 is also installed. But it doesn’t work.
The question here is - does the switch not work or the script by itself.
What happens if you execute the script manually inside a PS7 environment?
![]()
If your Powershell does not know a catch statement, then there is really something wrong with this machine.
Do you get the same message if you manually do these lines?
$borderVersion = 13
try {
# works only if process is running, normally it's ok
$veeamVersion = [int](Get-Process | Where {$_.Name -like "*Veeam.Backup.Service*"}).ProductVersion.Substring(0,2)
}
catch {
Write-Host "Could not determine Veeam version, assuming v13"
$veeamVersion = $borderVersion
}
If yes i would inspect the Powershell installation on this machine.
The output is: Could not determine Veeam version, assuming v13
Can you run
(Get-Process | Where {$_.Name -like "*Veeam.Backup.Service*"}).ProductVersion
And if that fails:
Get-Process | Where-Object { $_.Name -match "Veeam" } | Select-Object Name, ProductVersion
My PS skills are horrible, but I hope that are the right commands. @andreas-doehler correct me please, in case I am wrong
That means the script runs. Why do you get the strange error message than with the complete script?
Yes, I wonder about that too.