Skip to content

[BUG] DeployVeeamConfiguration.ps1 fails on Windows PowerShell 5.1 (Veeam module requires PowerShell 7) - VBR 13 #132

@birolbenli

Description

@birolbenli

What happened?

Summary

During installation/config deployment, DeployVeeamConfiguration.ps1 fails when importing Veeam.Backup.PowerShell because the Veeam module requires PowerShell 7+, but the installer/deployment tool is running under Windows PowerShell 5.1.

Environment

  • VeeamNotify version: v2.1.2
  • Windows PowerShell version: 5.1.17763.8146
  • PowerShell 7 installed?: [Yes/No]
    • If Yes: pwsh -v output: [paste here]
  • Veeam Backup & Replication build number: 13.0.1.1071
  • OS version: [e.g., Windows Server 2019/2022 + build] (optional)

Steps to reproduce

  1. Run the installer:
    Set-ExecutionPolicy Bypass -Scope Process -Force; `
    [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; `
    iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/tigattack/VeeamNotify/main/Installer.ps1'))
  2. Select:
    • Download source: Version
    • Version: v2.1.2
  3. Choose to configure now (Y)
  4. Run the configuration deployment tool (Y)
  5. Error occurs during Import-Module Veeam.Backup.PowerShell

Expected behavior

The deployment tool should either:

  • run under PowerShell 7 automatically / instruct the user to run it with pwsh, OR
  • detect the PowerShell version and show a clear message before proceeding.

Actual behavior / error

Import-Module : The version of Windows PowerShell on this computer is '5.1.17763.8146'.
The module 'C:\Program Files\Veeam\Backup and Replication\Console\Veeam.Backup.PowerShell\Veeam.Backup.PowerShell.psd1'
requires a minimum Windows PowerShell version of '7.0' to run.
At C:\VeeamScripts\VeeamNotify\resources\DeployVeeamConfiguration.ps1:322 char:1
+ Import-Module Veeam.Backup.PowerShell -DisableNameChecking
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable (...) [Import-Module], InvalidOperationException
    + FullyQualifiedErrorId : Modules_InsufficientPowerShellVersion,Microsoft.PowerShell.Commands.ImportModuleCommand

Suggested fix (optional)

Add a PowerShell version check at the start of the deployment script and/or installer.
If $PSVersionTable.PSVersion.Major -lt 7, print instructions to run:

pwsh -NoProfile -ExecutionPolicy Bypass -File "C:\VeeamScripts\VeeamNotify\resources\DeployVeeamConfiguration.ps1"

References (format examples)

Steps To Reproduce

No response

VeeamNotify version

v2.1.2

PowerShell version

5.1

Veeam Backup & Replication build number

13.0.1.1071

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions