Digressive / HyperV-Backup-Utility

Flexible Hyper-V Backup Utility
https://gal.vin/posts/vm-backup-for-hyper-v/
MIT License
125 stars 40 forks source link

Translation problems with -NoPerms #29

Closed Respekt79 closed 1 month ago

Respekt79 commented 10 months ago

Hi,

first of all, thank you very much for the ingenious script. :-)

Here is my "problem" and the solution:

I use your script on a Windows Server - with German installation.

The script checks the status of the virtual machine at line 1226 and 1231.

$VmState.Status -ne 'Operating normally'

This state is in german: 'Normaler Betrieb'

As a result, the script does not recognize the status of the virtual machine as saved - and waits almost endlessly.

Here I had to adapt the script - as it is called in German:

$VmState.Status -ne 'Normaler Betrieb'


If ($VmState.State -ne 'Off' -OR $VmState.State -ne 'Saved' -AND $VmState.Status -ne 'Normaler Betrieb') { do { Write-Log -Type Err -Evt "(VM:$Vm) VM not in the desired state. Waiting 60 seconds..." Start-Sleep -S 60 } until ($VmState.State -eq 'Off' -OR $VmState.State -eq 'Saved' -AND $VmState.Status -eq 'Normaler Betrieb') }


Perhaps this experience can be taken into account for a future update of the script and a solution for non-English installation of the server OS can be found

Greetings Markus

Digressive commented 10 months ago

Hi there Markus,

I've done some digging and currently cannot find a language agnostic way of detecting a state that a VM is in. Microsoft's own docs say to use the strings that Get-VM returns.

I'll continue to hunt for a way to get the VM state without using the language specific strings, in the mean time I have no problems if others want to fork Hyper-V Backup Utility for their own needs.

Thanks for the issue report! Mike

Digressive commented 1 month ago

Closing this issue for my sanity. As I said above, I need a way for Hyper-V to report VM states in a language agnostic way.