a few users of my scripts reported issues like that:
It seems I’ve found the cause of the issue. For some reason PRTG won’t find the module when using: Import-module -name Veeam.Backup.Powershell as it claims it can’t find it.
However, if I after “-name”, specify the complete path to the Veeam.Backup.Powershell.dll, the script is successful. So the script is working fine and as intended, and the issue seems to be on our server and it’s ability to load the Module at times.
Not all have tried to import the dll, but all have the situation where the module does not seem to be available to all users.
I've seen this with other modules too, sometimes you'll have to specify the exact path, if it isn't available as part of the system environment variables.
Import-module -name "C:\Program Files\Veeam\Backup and Replication\Console\Veeam.Backup.PowerShell\Veeam.Backup.PowerShell.psd1"
this is ran in the same shell when the unattended installation has completed. Then a new PowerShell window is open to run the Veeam configuration script
Regards,
Michael Cade
Global Technologist
Veeam Software
Email: Michael.Cade@Veeam.com
Twitter: @MichaelCade1