I just wanted to share my short code snippet to use the same Powershell Script for different Veeam Versions.
This was my solution to migrate all my old scripts for Veeam11 without dropping the support for older versions.
# Accounts for switch from PSSnapin to Module in v11
if (-Not (Get-Module -ListAvailable -Name Veeam.Backup.PowerShell)){
Add-PSSnapin -PassThru VeeamPSSnapIn -ErrorAction Stop | Out-Null
}
Note that you shouldn't have to import the Veeam PowerShell module in your scripts anymore as modules auto-import anytime you use a cmdlet specified within the module. That said, importing the module manually is perfectly valid as well.